[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: |
|
||||||||
| Issue Links: |
|
||||||||
| 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 |