Skip to content

Commit 7f51ddc

Browse files
committed
Use of uninitialized value $opt{"myisamstat"} in numeric eq (==)
#702
1 parent c5e5c81 commit 7f51ddc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mysqltuner.pl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,9 @@ package main;
235235
if ( $opt{nopfstat} == 1 ); # Don't print performance schema information
236236
$opt{idxstat} = 0 if ( $opt{noidxstat} == 1 ); # Don't print index information
237237
$opt{structstat} = 0
238-
if ( $opt{nostructstat} == 1 ); # Don't print table struct information
239-
$opt{myisamstat} = 0
240-
if ( $opt{nomyisamstat} == 1 ); # Don't print MyISAM table information
241-
238+
if ( not defined($opt{structstat}) or $opt{nostructstat} == 1 ); # Don't print table struct information
239+
$opt{myisamstat} = 1
240+
if ( not defined($opt{myisamstat}) or $opt{nomyisamstat} == 0 ); # Don't print MyISAM table information
242241
# for RPM distributions
243242
$opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv"
244243
unless ( defined $opt{cvefile} and -f "$opt{cvefile}" );
@@ -3857,7 +3856,7 @@ sub mysql_stats {
38573856

38583857
# Recommendations for MyISAM
38593858
sub mysql_myisam {
3860-
return 0 unless $opt{'myisamstat'} == 1;
3859+
return 0 unless ($opt{'myisamstat'} > 0);
38613860
subheaderprint "MyISAM Metrics";
38623861
my $nb_myisam_tables = select_one(
38633862
"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 {
58075806

58085807
# REcommendations for Tables
58095808
sub mysql_table_structures {
5810-
return 0 unless $opt{structstat} == 1;
5809+
return 0 unless ($opt{structstat} > 0);
58115810
subheaderprint "Table structures analysis";
58125811

58135812
my @primaryKeysNbTables = select_array(

0 commit comments

Comments
 (0)