From 7f51ddcf0772bfa49c33b80fe29e3b2bf352bb4c Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Fri, 7 Jul 2023 09:13:46 +0200 Subject: [PATCH 1/2] Use of uninitialized value $opt{"myisamstat"} in numeric eq (==) #702 --- mysqltuner.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 890cffeb8..89faaacb2 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -235,10 +235,9 @@ package main; if ( $opt{nopfstat} == 1 ); # Don't print performance schema information $opt{idxstat} = 0 if ( $opt{noidxstat} == 1 ); # Don't print index information $opt{structstat} = 0 - if ( $opt{nostructstat} == 1 ); # Don't print table struct information -$opt{myisamstat} = 0 - if ( $opt{nomyisamstat} == 1 ); # Don't print MyISAM table information - + if ( not defined($opt{structstat}) or $opt{nostructstat} == 1 ); # Don't print table struct information +$opt{myisamstat} = 1 + if ( not defined($opt{myisamstat}) or $opt{nomyisamstat} == 0 ); # Don't print MyISAM table information # for RPM distributions $opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv" unless ( defined $opt{cvefile} and -f "$opt{cvefile}" ); @@ -3857,7 +3856,7 @@ sub mysql_stats { # Recommendations for MyISAM sub mysql_myisam { - return 0 unless $opt{'myisamstat'} == 1; + return 0 unless ($opt{'myisamstat'} > 0); subheaderprint "MyISAM Metrics"; my $nb_myisam_tables = select_one( "SELECT COUNT(*) FROM information_schema.TABLES WHERE ENGINE='MyISAM' and TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema')" @@ -5807,7 +5806,7 @@ sub get_wsrep_option { # REcommendations for Tables sub mysql_table_structures { - return 0 unless $opt{structstat} == 1; + return 0 unless ($opt{structstat} > 0); subheaderprint "Table structures analysis"; my @primaryKeysNbTables = select_array( From 54fe8c9c6156a73b4c6c2440dd163929186ed58d Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Fri, 7 Jul 2023 09:14:11 +0200 Subject: [PATCH 2/2] update version --- mysqltuner.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 89faaacb2..f6f06e9e6 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# mysqltuner.pl - Version 2.2.6 +# mysqltuner.pl - Version 2.2.7 # High Performance MySQL Tuning Script # Copyright (C) 2006-2023 Major Hayden - major@mhtx.net # Copyright (C) 2015-2023 Jean-Marie Renouard - jmrenouard@gmail.com @@ -57,7 +57,7 @@ package main; #use Env; # Set up a few variables for use in the script -my $tunerversion = "2.2.6"; +my $tunerversion = "2.2.7"; my ( @adjvars, @generalrec ); # Set defaults @@ -7354,7 +7354,7 @@ sub which { =head1 NAME - MySQLTuner 2.2.6 - MySQL High Performance Tuning Script + MySQLTuner 2.2.7 - MySQL High Performance Tuning Script =head1 IMPORTANT USAGE GUIDELINES