From e454b30c61c6d6f74badee0851b6c991dc939187 Mon Sep 17 00:00:00 2001 From: git001 Date: Wed, 28 Dec 2016 10:52:33 +0100 Subject: [PATCH] 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. --- mysqltuner.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysqltuner.pl b/mysqltuner.pl index 0ab8d02..b93faca 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -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"; }