mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-18 00:14:12 +00:00
Removed --aux-dsn, enabled passing an optional dsn with the extra arguments
This commit is contained in:
@@ -12378,6 +12378,13 @@ sub main {
|
||||
|
||||
my $dp = $o->DSNParser();
|
||||
$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.
|
||||
my $review_dsn = handle_special_defaults($o, 'review');
|
||||
@@ -12943,7 +12950,7 @@ sub main {
|
||||
# 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.
|
||||
if ( $o->get('since') || $o->get('until') ) {
|
||||
if ( my $aux_dsn = $o->get('aux-dsn') ) {
|
||||
if ( $aux_dsn ) {
|
||||
$aux_dbh = get_cxn(
|
||||
for => '--aux',
|
||||
dsn => $aux_dsn,
|
||||
|
@@ -13,7 +13,7 @@ use Test::More tests => 1;
|
||||
|
||||
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 $output;
|
||||
|
||||
|
@@ -16,7 +16,7 @@ use PerconaTest;
|
||||
# #############################################################################
|
||||
# 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(
|
||||
$output,
|
||||
qr/Can't use string/,
|
||||
|
@@ -401,7 +401,7 @@ $output = output(
|
||||
'--review', "$dsn,D=test,t=query_review",
|
||||
'--history', "$dsn,D=test,t=query_review_history",
|
||||
qw(--no-report --no-continue-on-error),
|
||||
"$trunk/t/lib/samples/slow002.txt")
|
||||
"$trunk/t/lib/samples/slowlogs/slow002.txt")
|
||||
},
|
||||
stderr => 1,
|
||||
);
|
||||
|
@@ -71,12 +71,12 @@ SKIP: {
|
||||
# The result file is correct: it's the one that has all quries from
|
||||
# slow033.txt.
|
||||
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"',
|
||||
);
|
||||
|
||||
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"',
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user