Use of uninitialized value $opt{"myisamstat"} in numeric eq (==)

#702
This commit is contained in:
Jean-Marie Renouard 2023-07-07 09:13:46 +02:00
parent c5e5c81266
commit 7f51ddcf07

View file

@ -235,10 +235,9 @@ $opt{pfstat} = 0
if ( $opt{nopfstat} == 1 ); # Don't print performance schema information if ( $opt{nopfstat} == 1 ); # Don't print performance schema information
$opt{idxstat} = 0 if ( $opt{noidxstat} == 1 ); # Don't print index information $opt{idxstat} = 0 if ( $opt{noidxstat} == 1 ); # Don't print index information
$opt{structstat} = 0 $opt{structstat} = 0
if ( $opt{nostructstat} == 1 ); # Don't print table struct information if ( not defined($opt{structstat}) or $opt{nostructstat} == 1 ); # Don't print table struct information
$opt{myisamstat} = 0 $opt{myisamstat} = 1
if ( $opt{nomyisamstat} == 1 ); # Don't print MyISAM table information if ( not defined($opt{myisamstat}) or $opt{nomyisamstat} == 0 ); # Don't print MyISAM table information
# for RPM distributions # for RPM distributions
$opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv" $opt{cvefile} = "/usr/share/mysqltuner/vulnerabilities.csv"
unless ( defined $opt{cvefile} and -f "$opt{cvefile}" ); unless ( defined $opt{cvefile} and -f "$opt{cvefile}" );
@ -3857,7 +3856,7 @@ sub mysql_stats {
# Recommendations for MyISAM # Recommendations for MyISAM
sub mysql_myisam { sub mysql_myisam {
return 0 unless $opt{'myisamstat'} == 1; return 0 unless ($opt{'myisamstat'} > 0);
subheaderprint "MyISAM Metrics"; subheaderprint "MyISAM Metrics";
my $nb_myisam_tables = select_one( 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')" "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 # REcommendations for Tables
sub mysql_table_structures { sub mysql_table_structures {
return 0 unless $opt{structstat} == 1; return 0 unless ($opt{structstat} > 0);
subheaderprint "Table structures analysis"; subheaderprint "Table structures analysis";
my @primaryKeysNbTables = select_array( my @primaryKeysNbTables = select_array(