diff --git a/lib/Processlist.pm b/lib/Processlist.pm index 556c1832..015b8508 100644 --- a/lib/Processlist.pm +++ b/lib/Processlist.pm @@ -275,7 +275,7 @@ sub parse_event { else { PTDEBUG && _d('Saving new query, state', $curr->[STATE]); push @new_cxn, [ - @$curr, # proc info + @{$curr}[0..7], # proc info int($query_start), # START $etime, # ETIME $time, # FSEEN @@ -290,7 +290,7 @@ sub parse_event { # But only save the new cxn if it's executing. PTDEBUG && _d('Saving query of new cxn, state', $curr->[STATE]); push @new_cxn, [ - @$curr, # proc info + @{$curr}[0..7], # proc info int($query_start), # START $etime, # ETIME $time, # FSEEN diff --git a/t/lib/Processlist.t b/t/lib/Processlist.t index 0bab3347..e2f7c2ad 100644 --- a/t/lib/Processlist.t +++ b/t/lib/Processlist.t @@ -890,6 +890,33 @@ is( "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. # #############################################################################