[DBAL-120] MySql platform getAlterTableSQL does not quote existing column names Created: 13/May/11  Updated: 19/Jun/11  Resolved: 19/Jun/11

Status: Resolved
Project: Doctrine DBAL
Component/s: Platforms
Affects Version/s: 2.0.4
Fix Version/s: 2.0.4

Type: Bug Priority: Major
Reporter: Devon Weller Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None

Attachments: Text File quote-mysql-change-colname.patch     Text File quote-mysql-change-keyname.patch    
Issue Links:
Duplicate
duplicates DBAL-96 Make approach towards identifier quot... Open

 Description   

When creating alter table SQL, the MySqlPlatform class does not quote names for columns of an existing table when building a CHANGE query. This can cause SQL errors.

It creates queries like this:

ALTER TABLE my_table CHANGE key `key` INTVARCHAR(255) DEFAULT '' NOT NULL';

Attached is a patch to fix this.

As an aside, is this the best way to contribute a patch? Or is a GitHub pull request better?



 Comments   
Comment by Devon Weller [ 13/May/11 ]

I also discovered a similar issue with key names. A second patch is attached.

Comment by Benjamin Eberlei [ 19/Jun/11 ]

This problem is a little more complicated, it will be fixed in DBAL-96 probably for 2.2

Generated at Wed Jul 30 05:22:32 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.