From f18a3ef33f9a7891dc7688a9b69ea4d392feac2a Mon Sep 17 00:00:00 2001 From: Jean-Marie Renouard Date: Wed, 2 Oct 2019 00:44:54 +0200 Subject: [PATCH] Update mysqltuner.pl FAIL Execute SQL / return code: 256 #442 disable column type to ENUM suggestion #356 --- mysqltuner.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 3e05f2822..18bc62519 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -6034,14 +6034,19 @@ sub mysql_tables { infoprint " Current Fieldtype: $current_type"; #infoprint " Optimal Fieldtype: Not available"; } - elsif ( $current_type ne $optimal_type ) { + elsif ( $current_type ne $optimal_type and $current_type !~ /.*DATETIME.*/ and $current_type !~ /.*TIMESTAMP.*/) { infoprint " Current Fieldtype: $current_type"; - infoprint " Optimal Fieldtype: $optimal_type"; - badprint + if ($optimal_type =~ /.*ENUM\(.*/ ) { + $optimal_type ="ENUM( ... )"; + } + infoprint " Optimal Fieldtype: $optimal_type "; + if ($optimal_type !~ /.*ENUM\(.*/ ) { + badprint "Consider changing type for column $_ in table $dbname.$tbname"; push( @generalrec, "ALTER TABLE \`$dbname\`.\`$tbname\` MODIFY \`$_\` $optimal_type;" ); + } } else {