Fix bug #616 get_pf_memory() returns bogus value

This commit is contained in:
Daniel Lewart 2022-10-31 18:30:08 -05:00
parent 5331b3e591
commit a8d3b6a5f5

View file

@ -3881,9 +3881,9 @@ sub get_pf_memory {
return 0 unless defined $myvar{'performance_schema'}; return 0 unless defined $myvar{'performance_schema'};
return 0 if $myvar{'performance_schema'} eq 'OFF'; return 0 if $myvar{'performance_schema'} eq 'OFF';
my @infoPFSMemory = grep /performance_schema.memory/, my @infoPFSMemory = grep { /\tperformance_schema[.]memory\t/msx }
select_array("SHOW ENGINE PERFORMANCE_SCHEMA STATUS"); select_array("SHOW ENGINE PERFORMANCE_SCHEMA STATUS");
return 0 if scalar(@infoPFSMemory) == 0; @infoPFSMemory == 1 || return 0;
$infoPFSMemory[0] =~ s/.*\s+(\d+)$/$1/g; $infoPFSMemory[0] =~ s/.*\s+(\d+)$/$1/g;
return $infoPFSMemory[0]; return $infoPFSMemory[0];
} }