From 49a1b603da6c47e1768832489aa66de95f57c5ab Mon Sep 17 00:00:00 2001 From: Myrdhin Date: Wed, 15 May 2019 10:52:51 +0200 Subject: [PATCH 1/2] Fix error when `innodb_stats_on_metadata` not defined --- mysqltuner.pl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 183a38c63..4f3f9a91d 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -5766,14 +5766,16 @@ sub mysql_innodb { sub check_metadata_perf { subheaderprint "Analysis Performance Metrics"; - infoprint "innodb_stats_on_metadata: " . $myvar{'innodb_stats_on_metadata'}; - if ( $myvar{'innodb_stats_on_metadata'} eq 'ON' ) { - badprint "Stat are updated during querying INFORMATION_SCHEMA."; - push @adjvars, "SET innodb_stats_on_metadata = OFF"; - - #Disabling innodb_stats_on_metadata - select_one("SET GLOBAL innodb_stats_on_metadata = OFF;"); - return 1; + if (defined $myvars{'innodb_stats_on_metadata'}) { + infoprint "innodb_stats_on_metadata: " . $myvar{'innodb_stats_on_metadata'}; + if ( $myvar{'innodb_stats_on_metadata'} eq 'ON' ) { + badprint "Stat are updated during querying INFORMATION_SCHEMA."; + push @adjvars, "SET innodb_stats_on_metadata = OFF"; + + #Disabling innodb_stats_on_metadata + select_one("SET GLOBAL innodb_stats_on_metadata = OFF;"); + return 1; + } } goodprint "No stat updates during querying INFORMATION_SCHEMA."; return 0; From b10c90ccf868f41028593d2cc02880782b52266e Mon Sep 17 00:00:00 2001 From: Myrdhin Date: Wed, 15 May 2019 11:01:46 +0200 Subject: [PATCH 2/2] Fix typo on `myvar` --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 4f3f9a91d..6077581c8 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -5766,7 +5766,7 @@ sub mysql_innodb { sub check_metadata_perf { subheaderprint "Analysis Performance Metrics"; - if (defined $myvars{'innodb_stats_on_metadata'}) { + if (defined $myvar{'innodb_stats_on_metadata'}) { infoprint "innodb_stats_on_metadata: " . $myvar{'innodb_stats_on_metadata'}; if ( $myvar{'innodb_stats_on_metadata'} eq 'ON' ) { badprint "Stat are updated during querying INFORMATION_SCHEMA.";