pt-kill: Add a --log-dsn option.

This is customer issue 23049.
This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-05-01 03:27:11 -03:00
parent bc058d6daf
commit 85756b0e94
4 changed files with 267 additions and 29 deletions

View File

@@ -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 => {