Skip to content

Commit a19d6cc

Browse files
authored
Merge pull request #817 from arossetti/master
escape databases when suggesting migrating from MyIsam to InnoDB
2 parents 7a2d821 + 9db65eb commit a19d6cc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mysqltuner.pl

+4-3
Original file line numberDiff line numberDiff line change
@@ -3935,14 +3935,15 @@ sub mysql_myisam {
39353935
my $sql_mig = "";
39363936
for my $myisam_table (
39373937
select_array(
3938-
"SELECT CONCAT(TABLE_SCHEMA, '.', TABLE_NAME) FROM information_schema.TABLES WHERE ENGINE='MyISAM' and TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema')"
3938+
"SELECT CONCAT('|',TABLE_SCHEMA, '|.|', TABLE_NAME,'|') FROM information_schema.TABLES WHERE ENGINE='MyISAM' and TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema')"
39393939
)
39403940
)
39413941
{
3942+
my $myisam_table_escape = $myisam_table =~ s/\|/\`/gr;
39423943
$sql_mig =
3943-
"${sql_mig}-- InnoDB migration for $myisam_table\nALTER TABLE $myisam_table ENGINE=InnoDB;\n\n";
3944+
"${sql_mig}-- InnoDB migration for $myisam_table_escape\nALTER TABLE $myisam_table_escape ENGINE=InnoDB;\n\n";
39443945
infoprint
3945-
"* InnoDB migration request for $myisam_table Table: ALTER TABLE $myisam_table ENGINE=InnoDB;";
3946+
"* InnoDB migration request for $myisam_table_escape Table: ALTER TABLE $myisam_table_escape ENGINE=InnoDB;";
39463947
}
39473948
dump_into_file( "migrate_myisam_to_innodb.sql", $sql_mig );
39483949
}

0 commit comments

Comments
 (0)