Fix for 883098: Extra processlist fields causing errors

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-08-01 18:43:03 -03:00
parent ad46ec779e
commit 654ebacf1c
2 changed files with 29 additions and 2 deletions

View File

@@ -275,7 +275,7 @@ sub parse_event {
else { else {
PTDEBUG && _d('Saving new query, state', $curr->[STATE]); PTDEBUG && _d('Saving new query, state', $curr->[STATE]);
push @new_cxn, [ push @new_cxn, [
@$curr, # proc info @{$curr}[0..7], # proc info
int($query_start), # START int($query_start), # START
$etime, # ETIME $etime, # ETIME
$time, # FSEEN $time, # FSEEN
@@ -290,7 +290,7 @@ sub parse_event {
# But only save the new cxn if it's executing. # But only save the new cxn if it's executing.
PTDEBUG && _d('Saving query of new cxn, state', $curr->[STATE]); PTDEBUG && _d('Saving query of new cxn, state', $curr->[STATE]);
push @new_cxn, [ push @new_cxn, [
@$curr, # proc info @{$curr}[0..7], # proc info
int($query_start), # START int($query_start), # START
$etime, # ETIME $etime, # ETIME
$time, # FSEEN $time, # FSEEN

View File

@@ -890,6 +890,33 @@ is(
"NULL STATE shouldn't cause warnings" "NULL STATE shouldn't cause warnings"
); );
# #############################################################################
# Extra processlist fields are ignored and don't cause errors
# https://bugs.launchpad.net/percona-toolkit/+bug/883098
# #############################################################################
$procs = [
[ [1, 'unauthenticated user', 'localhost', undef, 'Connect', 7,
'some state', 1, 0, 0, 1] ],
[ [1, 'unauthenticated user', 'localhost', undef, 'Connect', 8,
undef, 2, 1, 2, 0] ],
],
eval {
parse_n_times(
2,
code => sub {
return shift @$procs;
},
time => Transformers::unix_timestamp('2001-01-01 00:05:00'),
);
};
is(
$EVAL_ERROR,
'',
"Extra processlist fields don't cause errors"
);
# ############################################################################# # #############################################################################
# Done. # Done.
# ############################################################################# # #############################################################################