From 92dc77e4cdcdc2a7c3b4c0d800e229d547f742a9 Mon Sep 17 00:00:00 2001 From: jkavalik Date: Fri, 29 Apr 2016 12:56:24 +0200 Subject: [PATCH] Fix for #197 Merge GLOBAL status after SESSION - the non-global variables (like Percona from #184) will be present but stats are computed from GLOBAL counters which overwrite the SESSION ones if they exist. --- mysqltuner.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 1349f67..ac577b2 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -950,13 +950,13 @@ sub get_all_vars { debugprint "VERSION: " . $dummyselect . ""; $result{'MySQL Client'}{'Version'} = $dummyselect; - my @mysqlvarlist = select_array("SHOW GLOBAL VARIABLES"); - push( @mysqlvarlist, select_array("SHOW VARIABLES") ); + my @mysqlvarlist = select_array("SHOW VARIABLES"); + push( @mysqlvarlist, select_array("SHOW GLOBAL VARIABLES") ); arr2hash( \%myvar, \@mysqlvarlist ); $result{'Variables'} = %myvar; - my @mysqlstatlist = select_array("SHOW GLOBAL STATUS"); - push( @mysqlstatlist, select_array("SHOW STATUS") ); + my @mysqlstatlist = select_array("SHOW STATUS"); + push( @mysqlstatlist, select_array("SHOW GLOBAL STATUS") ); arr2hash( \%mystat, \@mysqlstatlist ); $result{'Status'} = %mystat;