diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_threads_processlist_status.test b/mysql-test/suite/rpl/t/rpl_perfschema_threads_processlist_status.test index ec2b9a65b0f9..f9f8243230d5 100644 --- a/mysql-test/suite/rpl/t/rpl_perfschema_threads_processlist_status.test +++ b/mysql-test/suite/rpl/t/rpl_perfschema_threads_processlist_status.test @@ -103,19 +103,25 @@ perl; { $declared_stages{$1} = 1; } + # Read extern declaration. + elsif (/extern\s+PSI_stage_info\s+([A-Za-z_0-9]+)\s*;/) + { + $declared_stages{$1} = 1; + } # Figure out when we enter and leave the array initialization. elsif (/PSI_stage_info\s*\*\s*all_server_stages\s*\[/) { $in_server_stage_list= 1; } - elsif (/\};/) { - $in_server_stage_list= 0; - } # Read element from list. elsif ($in_server_stage_list && - /\&\s*([A-Za-z_0-9]+)\s*,?/) + /\&\s*([A-Za-z_0-9]+)\s*(,|\};)/) { push(@listed_stages, $1); + if ($2 eq "};") + { + $in_server_stage_list= 0; + } } } close MYSQLD_CC or die "Error $? closing $mysqld: $!";