mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-28 00:21:56 +00:00
Merged fix-821703-processlist-null-state
This commit is contained in:
@@ -2959,7 +2959,7 @@ sub parse_event {
|
|||||||
int($query_start), # START
|
int($query_start), # START
|
||||||
$etime, # ETIME
|
$etime, # ETIME
|
||||||
$time, # FSEEN
|
$time, # FSEEN
|
||||||
{ $curr->[STATE] => 0 }, # PROFILE
|
{ ($curr->[STATE] || "") => 0 }, # PROFILE
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2973,7 +2973,7 @@ sub parse_event {
|
|||||||
int($query_start), # START
|
int($query_start), # START
|
||||||
$etime, # ETIME
|
$etime, # ETIME
|
||||||
$time, # FSEEN
|
$time, # FSEEN
|
||||||
{ $curr->[STATE] => 0 }, # PROFILE
|
{ ($curr->[STATE] || "") => 0 }, # PROFILE
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2398,7 +2398,7 @@ sub parse_event {
|
|||||||
int($query_start), # START
|
int($query_start), # START
|
||||||
$etime, # ETIME
|
$etime, # ETIME
|
||||||
$time, # FSEEN
|
$time, # FSEEN
|
||||||
{ $curr->[STATE] => 0 }, # PROFILE
|
{ ($curr->[STATE] || "") => 0 }, # PROFILE
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2412,7 +2412,7 @@ sub parse_event {
|
|||||||
int($query_start), # START
|
int($query_start), # START
|
||||||
$etime, # ETIME
|
$etime, # ETIME
|
||||||
$time, # FSEEN
|
$time, # FSEEN
|
||||||
{ $curr->[STATE] => 0 }, # PROFILE
|
{ ($curr->[STATE] || "") => 0 }, # PROFILE
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -279,7 +279,7 @@ sub parse_event {
|
|||||||
int($query_start), # START
|
int($query_start), # START
|
||||||
$etime, # ETIME
|
$etime, # ETIME
|
||||||
$time, # FSEEN
|
$time, # FSEEN
|
||||||
{ $curr->[STATE] => 0 }, # PROFILE
|
{ ($curr->[STATE] || "") => 0 }, # PROFILE
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -294,7 +294,7 @@ sub parse_event {
|
|||||||
int($query_start), # START
|
int($query_start), # START
|
||||||
$etime, # ETIME
|
$etime, # ETIME
|
||||||
$time, # FSEEN
|
$time, # FSEEN
|
||||||
{ $curr->[STATE] => 0 }, # PROFILE
|
{ ($curr->[STATE] || "") => 0 }, # PROFILE
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings FATAL => 'all';
|
use warnings FATAL => 'all';
|
||||||
use English qw(-no_match_vars);
|
use English qw(-no_match_vars);
|
||||||
use Test::More tests => 35;
|
use Test::More;
|
||||||
|
|
||||||
use Processlist;
|
use Processlist;
|
||||||
use PerconaTest;
|
use PerconaTest;
|
||||||
@@ -862,7 +862,35 @@ eval { $pl->find([$proc], %find_spec) };
|
|||||||
ok !$@,
|
ok !$@,
|
||||||
"Bug 923896: NULL Time in processlist doesn't fail for idle_time+Command=Sleep";
|
"Bug 923896: NULL Time in processlist doesn't fail for idle_time+Command=Sleep";
|
||||||
|
|
||||||
|
# #############################################################################
|
||||||
|
# NULL STATE doesn't generate warnings
|
||||||
|
# https://bugs.launchpad.net/percona-toolkit/+bug/821703
|
||||||
|
# #############################################################################
|
||||||
|
|
||||||
|
$procs = [
|
||||||
|
[ [1, 'unauthenticated user', 'localhost', undef, 'Connect', 7,
|
||||||
|
'some state', 1] ],
|
||||||
|
[ [1, 'unauthenticated user', 'localhost', undef, 'Connect', 8,
|
||||||
|
undef, 2] ],
|
||||||
|
],
|
||||||
|
|
||||||
|
eval {
|
||||||
|
parse_n_times(
|
||||||
|
2,
|
||||||
|
code => sub {
|
||||||
|
return shift @$procs;
|
||||||
|
},
|
||||||
|
time => Transformers::unix_timestamp('2001-01-01 00:05:00'),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
is(
|
||||||
|
$EVAL_ERROR,
|
||||||
|
'',
|
||||||
|
"NULL STATE shouldn't cause warnings"
|
||||||
|
);
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Done.
|
# Done.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
exit;
|
done_testing;
|
||||||
|
Reference in New Issue
Block a user