Fix Argument "NULL" isn't numeric
Argument "NULL" isn't numeric in numeric ge (>=) at ./mysqltuner.pl line 305 (#1) (W numeric) The indicated string was fed as an argument to an operator that expected a numeric value instead. If you're fortunate the message will identify which operator was so unfortunate.
This commit is contained in:
parent
188f69c811
commit
e454b30c61
1 changed files with 3 additions and 0 deletions
|
@ -302,6 +302,9 @@ sub infoprinthcmd {
|
||||||
# Calculates the parameter passed in bytes, then rounds it to one decimal place
|
# Calculates the parameter passed in bytes, then rounds it to one decimal place
|
||||||
sub hr_bytes {
|
sub hr_bytes {
|
||||||
my $num = shift;
|
my $num = shift;
|
||||||
|
return "0B" unless defined($num) ;
|
||||||
|
return "0B" if $num eq "NULL" ;
|
||||||
|
|
||||||
if ( $num >= ( 1024**3 ) ) { #GB
|
if ( $num >= ( 1024**3 ) ) { #GB
|
||||||
return sprintf( "%.1f", ( $num / ( 1024**3 ) ) ) . "G";
|
return sprintf( "%.1f", ( $num / ( 1024**3 ) ) ) . "G";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue