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:
git001 2016-12-28 10:52:33 +01:00 committed by GitHub
parent 188f69c811
commit e454b30c61

View file

@ -302,6 +302,9 @@ sub infoprinthcmd {
# Calculates the parameter passed in bytes, then rounds it to one decimal place
sub hr_bytes {
my $num = shift;
return "0B" unless defined($num) ;
return "0B" if $num eq "NULL" ;
if ( $num >= ( 1024**3 ) ) { #GB
return sprintf( "%.1f", ( $num / ( 1024**3 ) ) ) . "G";
}