mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 13:46:22 +00:00
pt-kill: Add a --log-dsn option.
This is customer issue 23049.
This commit is contained in:
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 32;
|
||||
use Test::More tests => 33;
|
||||
|
||||
use Processlist;
|
||||
use PerconaTest;
|
||||
@@ -600,6 +600,17 @@ my %find_spec = (
|
||||
},
|
||||
);
|
||||
|
||||
my $matching_query =
|
||||
{ 'Time' => '91',
|
||||
'Command' => 'Query',
|
||||
'db' => undef,
|
||||
'Id' => '43',
|
||||
'Info' => 'select * from foo',
|
||||
'User' => 'msandbox',
|
||||
'State' => 'executing',
|
||||
'Host' => 'localhost'
|
||||
};
|
||||
|
||||
my @queries = $pl->find(
|
||||
[ { 'Time' => '488',
|
||||
'Command' => 'Connect',
|
||||
@@ -675,33 +686,24 @@ my @queries = $pl->find(
|
||||
'State' => 'Locked',
|
||||
'Host' => 'localhost'
|
||||
},
|
||||
{ 'Time' => '91',
|
||||
'Command' => 'Query',
|
||||
'db' => undef,
|
||||
'Id' => '43',
|
||||
'Info' => 'select * from foo',
|
||||
'User' => 'msandbox',
|
||||
'State' => 'executing',
|
||||
'Host' => 'localhost'
|
||||
},
|
||||
$matching_query,
|
||||
],
|
||||
%find_spec,
|
||||
);
|
||||
|
||||
my $expected = [
|
||||
{ 'Time' => '91',
|
||||
'Command' => 'Query',
|
||||
'db' => undef,
|
||||
'Id' => '43',
|
||||
'Info' => 'select * from foo',
|
||||
'User' => 'msandbox',
|
||||
'State' => 'executing',
|
||||
'Host' => 'localhost'
|
||||
},
|
||||
];
|
||||
my $expected = [ $matching_query ];
|
||||
|
||||
is_deeply(\@queries, $expected, 'Basic find()');
|
||||
|
||||
{
|
||||
# Internal, fragile test!
|
||||
is_deeply(
|
||||
$pl->{_reasons_for_matching}->{$matching_query},
|
||||
[ 'Exceeds busy time', 'Query matches Command spec', 'Query matches Info spec', ],
|
||||
"_reasons_for_matching works"
|
||||
);
|
||||
}
|
||||
|
||||
%find_spec = (
|
||||
busy_time => 1,
|
||||
ignore => {
|
||||
|
Reference in New Issue
Block a user