Skip to content

Commit

Permalink
Update mysqltuner.pl
Browse files Browse the repository at this point in the history
FAIL Execute SQL / return code: 256 #442
disable column type to ENUM suggestion #356
  • Loading branch information
jmrenouard committed Oct 1, 2019
1 parent a9bed2f commit f18a3ef
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mysqltuner.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f18a3ef

Please sign in to comment.