mirror of
https://github.com/major/MySQLTuner-perl.git
synced 2024-09-21 07:47:08 +00:00
#242 initiliaze $data_free to 0 if not defined or is empty
This commit is contained in:
parent
9bdad9a1b8
commit
8f33b55fea
@ -30,7 +30,7 @@
|
||||
# Everett Barnes Tom Krouper Gary Barrueto
|
||||
# Simon Greenaway Adam Stein Isart Montane
|
||||
# Baptiste M. Cole Turner Major Hayden
|
||||
# Joe Ashcraft Jean-Marie Renouard
|
||||
# Joe Ashcraft Jean-Marie Renouard Christian Loos
|
||||
#
|
||||
# Inspired by Matthew Montgomery's tuning-primer.sh script:
|
||||
# http://forge.mysql.com/projects/view.php?id=44
|
||||
@ -72,6 +72,7 @@ my %opt = (
|
||||
"port" => 0,
|
||||
"user" => 0,
|
||||
"pass" => 0,
|
||||
"password" => 0,
|
||||
"skipsize" => 0,
|
||||
"checkversion" => 0,
|
||||
"updateversion" => 0,
|
||||
@ -111,7 +112,8 @@ my $getOptionsCheck = GetOptions(
|
||||
'template=s', 'reportfile=s',
|
||||
'cvefile=s', 'bannedports=s',
|
||||
'updateversion', 'maxportallowed=s',
|
||||
'verbose', 'sysstat'
|
||||
'verbose', 'sysstat',
|
||||
'password=s',
|
||||
);
|
||||
|
||||
#If params are incorrect return help
|
||||
@ -182,6 +184,9 @@ my $basic_password_files =
|
||||
? abs_path( dirname(__FILE__) ) . "/basic_passwords.txt"
|
||||
: abs_path( $opt{passwordfile} );
|
||||
|
||||
# Related to password option
|
||||
$opt{pass}=$opt{password} if ($opt{pass} eq 0 and $opt{password} ne 0);
|
||||
|
||||
# for RPM distributions
|
||||
$basic_password_files = "/usr/share/mysqltuner/basic_passwords.txt"
|
||||
unless -f "$basic_password_files";
|
||||
@ -1907,6 +1912,7 @@ sub check_storage_engines {
|
||||
my $total_free=0;
|
||||
foreach my $table_line (@{$result{'Tables'}{'Fragmented tables'}}) {
|
||||
my ($table_name,$data_free)=split(/\s+/,$table_line);
|
||||
$data_free=0 unless defined($data_free) or $data_free == '';
|
||||
$data_free=$data_free/1024/1024;
|
||||
$total_free+=$data_free;
|
||||
push( @generalrec,
|
||||
@ -4327,6 +4333,10 @@ Jean-Marie Renouard
|
||||
|
||||
Stephan GroBberndt
|
||||
|
||||
=item *
|
||||
|
||||
Christian Loos
|
||||
|
||||
=back
|
||||
|
||||
=head1 SUPPORT
|
||||
|
Loading…
Reference in New Issue
Block a user