Skip to content

Commit 3159e13

Browse files
authored
Merge pull request #703 from jmrenouard/master
Use of uninitialized value $opt{"myisamstat"} in numeric eq (==) #702
2 parents c5e5c81 + 54fe8c9 commit 3159e13

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

mysqltuner.pl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env perl
2-
# mysqltuner.pl - Version 2.2.6
2+
# mysqltuner.pl - Version 2.2.7
33
# High Performance MySQL Tuning Script
44
# Copyright (C) 2006-2023 Major Hayden - [email protected]
55
# Copyright (C) 2015-2023 Jean-Marie Renouard - [email protected]
@@ -57,7 +57,7 @@ package main;
5757
#use Env;
5858

5959
# Set up a few variables for use in the script
60-
my $tunerversion = "2.2.6";
60+
my $tunerversion = "2.2.7";
6161
my ( @adjvars, @generalrec );
6262

6363
# Set defaults
@@ -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(
@@ -7355,7 +7354,7 @@ sub which {
73557354
73567355
=head1 NAME
73577356
7358-
MySQLTuner 2.2.6 - MySQL High Performance Tuning Script
7357+
MySQLTuner 2.2.7 - MySQL High Performance Tuning Script
73597358
73607359
=head1 IMPORTANT USAGE GUIDELINES
73617360

0 commit comments

Comments
 (0)