Jira issue originally created by user adrenalin:
This is a broken feature, because escaping only sometimes (behavior at least in 2.3, if it has not been fixed after that) leads to breaking things. It is possible to CREATE a column named usage (without any backticks in the code), but things break from that point on. If I try to change the column name to a non-reserved word later, ALTER TABLE syntax will break
An exception occurred while executing 'ALTER TABLE products CHANGE usage purpose VARCHAR(256) NOT NULL':
SQLSTATE: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage purpose VARCHAR(256) NOT NULL' at line 1
Migrating down then again escapes the column name even if it wasn't escaped in the definition.
I found a ticket from 2012 describing that column names using reserved keywords should be escaped manually, but since migrations will lead into a dead-end with at least using usage as a column name, this feature is somewhat broken.
Comment created by @deeky666:
[~adrenalin] There have been some fixes around quoting identifiers in DDL lately. It seems there is one missing around $oldColumnName in MySqlPlatform::getAlterTableSQL().
I have moved this issue to DBAL as it is an issue there.
Patch supplied in PR: #545
Comment created by @doctrinebot:
A related Github Pull-Request [GH-545] was closed:
Fixed in commit: 9d6300f
Issue was closed with resolution "Fixed"