Update mysqltuner.pl

FAIL Execute SQL / return code: 256 #442
disable column type to ENUM suggestion #356
This commit is contained in:
Jean-Marie Renouard 2019-10-02 00:44:54 +02:00
parent a9bed2ffa0
commit f18a3ef33f

View file

@ -6034,14 +6034,19 @@ sub mysql_tables {
infoprint " Current Fieldtype: $current_type"; infoprint " Current Fieldtype: $current_type";
#infoprint " Optimal Fieldtype: Not available"; #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 " Current Fieldtype: $current_type";
if ($optimal_type =~ /.*ENUM\(.*/ ) {
$optimal_type ="ENUM( ... )";
}
infoprint " Optimal Fieldtype: $optimal_type "; infoprint " Optimal Fieldtype: $optimal_type ";
if ($optimal_type !~ /.*ENUM\(.*/ ) {
badprint badprint
"Consider changing type for column $_ in table $dbname.$tbname"; "Consider changing type for column $_ in table $dbname.$tbname";
push( @generalrec, push( @generalrec,
"ALTER TABLE \`$dbname\`.\`$tbname\` MODIFY \`$_\` $optimal_type;" "ALTER TABLE \`$dbname\`.\`$tbname\` MODIFY \`$_\` $optimal_type;"
); );
}
} }
else { else {