Details
Description
Methods in the MySql Platform that use the table name are not escaping the table name. This causes problems when your table name is the same as a reserved word in MySql. Example:
public function getListTableConstraintsSQL($table)
{ return 'SHOW INDEX FROM ' . $table; }If my table name is User this method will fail and cause a SQL error because the word User is a reserved word in MySql. You need to escape the table name with backticks to prevent these errors. Example:
public function getListTableConstraintsSQL($table)
{ return 'SHOW INDEX FROM `' . $table . '`'; }I encountered this problem while reverse engineering my existing MySql database. I've attached a fixed version that solved my reverse engineering problems.
Issue Links
- duplicates
-
DBAL-91
orm:convert-mapping SchemaException on Postgres reserved words
-