mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Removed --aux-dsn, enabled passing an optional dsn with the extra arguments
This commit is contained in:
+8
-1
@@ -12379,6 +12379,13 @@ sub main {
|
|||||||
my $dp = $o->DSNParser();
|
my $dp = $o->DSNParser();
|
||||||
$dp->prop('set-vars', $o->get('set-vars'));
|
$dp->prop('set-vars', $o->get('set-vars'));
|
||||||
|
|
||||||
|
my $aux_dsn;
|
||||||
|
for my $i (0..$#ARGV) {
|
||||||
|
next if -e $ARGV[$i];
|
||||||
|
$aux_dsn = $dp->parse(splice(@ARGV, $i, 1));
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
|
||||||
# Frequently used options.
|
# Frequently used options.
|
||||||
my $review_dsn = handle_special_defaults($o, 'review');
|
my $review_dsn = handle_special_defaults($o, 'review');
|
||||||
my $history_dsn = handle_special_defaults($o, 'history');
|
my $history_dsn = handle_special_defaults($o, 'history');
|
||||||
@@ -12943,7 +12950,7 @@ sub main {
|
|||||||
# will need this callback to execute the expression. We don't know what
|
# will need this callback to execute the expression. We don't know what
|
||||||
# type of time value the user gave, so we'll create the callback in any case.
|
# type of time value the user gave, so we'll create the callback in any case.
|
||||||
if ( $o->get('since') || $o->get('until') ) {
|
if ( $o->get('since') || $o->get('until') ) {
|
||||||
if ( my $aux_dsn = $o->get('aux-dsn') ) {
|
if ( $aux_dsn ) {
|
||||||
$aux_dbh = get_cxn(
|
$aux_dbh = get_cxn(
|
||||||
for => '--aux',
|
for => '--aux',
|
||||||
dsn => $aux_dsn,
|
dsn => $aux_dsn,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use Test::More tests => 1;
|
|||||||
|
|
||||||
use PerconaTest;
|
use PerconaTest;
|
||||||
|
|
||||||
my $run_with = "$trunk/bin/pt-query-digest --report-format=query_report --limit 10 $trunk/t/lib/samples/";
|
my $run_with = "$trunk/bin/pt-query-digest --report-format=query_report --limit 10 $trunk/t/lib/samples/slowlogs/";
|
||||||
my $cmd;
|
my $cmd;
|
||||||
my $output;
|
my $output;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use PerconaTest;
|
|||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Issue 565: mk-query-digest isn't compiling filter correctly
|
# Issue 565: mk-query-digest isn't compiling filter correctly
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
my $output = `$trunk/bin/pt-query-digest --type tcpdump --filter '\$event->{No_index_used} || \$event->{No_good_index_used}' --group-by tables $trunk/t/lib/samples/tcpdump014.txt 2>&1`;
|
my $output = `$trunk/bin/pt-query-digest --type tcpdump --filter '\$event->{No_index_used} || \$event->{No_good_index_used}' --group-by tables $trunk/t/lib/samples/tcpdump/tcpdump014.txt 2>&1`;
|
||||||
unlike(
|
unlike(
|
||||||
$output,
|
$output,
|
||||||
qr/Can't use string/,
|
qr/Can't use string/,
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ $output = output(
|
|||||||
'--review', "$dsn,D=test,t=query_review",
|
'--review', "$dsn,D=test,t=query_review",
|
||||||
'--history', "$dsn,D=test,t=query_review_history",
|
'--history', "$dsn,D=test,t=query_review_history",
|
||||||
qw(--no-report --no-continue-on-error),
|
qw(--no-report --no-continue-on-error),
|
||||||
"$trunk/t/lib/samples/slow002.txt")
|
"$trunk/t/lib/samples/slowlogs/slow002.txt")
|
||||||
},
|
},
|
||||||
stderr => 1,
|
stderr => 1,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -71,12 +71,12 @@ SKIP: {
|
|||||||
# The result file is correct: it's the one that has all quries from
|
# The result file is correct: it's the one that has all quries from
|
||||||
# slow033.txt.
|
# slow033.txt.
|
||||||
ok(
|
ok(
|
||||||
no_diff($run_with.'slow033.txt --aux-dsn h=127.1,P=12345,u=msandbox,p=msandbox --since "\'2009-07-08\' - INTERVAL 7 DAY"', "t/pt-query-digest/samples/slow033-since-Nd.txt"),
|
no_diff($run_with.'slow033.txt h=127.1,P=12345,u=msandbox,p=msandbox --since "\'2009-07-08\' - INTERVAL 7 DAY"', "t/pt-query-digest/samples/slow033-since-Nd.txt"),
|
||||||
'--since "\'2009-07-08\' - INTERVAL 7 DAY"',
|
'--since "\'2009-07-08\' - INTERVAL 7 DAY"',
|
||||||
);
|
);
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
no_diff($run_with.'slow033.txt --aux-dsn h=127.1,P=12345,u=msandbox,p=msandbox --until "\'2009-07-28\' - INTERVAL 1 DAY"', "t/pt-query-digest/samples/slow033-until-date.txt"),
|
no_diff($run_with.'slow033.txt h=127.1,P=12345,u=msandbox,p=msandbox --until "\'2009-07-28\' - INTERVAL 1 DAY"', "t/pt-query-digest/samples/slow033-until-date.txt"),
|
||||||
'--until "\'2009-07-28\' - INTERVAL 1 DAY"',
|
'--until "\'2009-07-28\' - INTERVAL 1 DAY"',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user