Bug #49286 Changing column name fails in ALTER TABLE wizard
Submitted: 1 Dec 2009 18:18 Modified: 12 Mar 2010 18:51
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:5.2 r4643 OS:Windows (XP)
Assigned to: Johannes Taxacher CPU Architecture:Any

[1 Dec 2009 18:18] Todd Farmer
Description:
When using the ALTER TABLE wizard, I changed the name of a column.  Instead of generating an appropriate ALTER TABLE tbl CHANGE oldcol newcol ... statement, it uses ALTER TABLE tbl DROP COLUMN oldcol, ADD COLUMN newcol ....

That is exceptionally dangerous, as the column data will be lost.

How to repeat:
Try to change the column name in the ALTER TABLE wizard.

Suggested fix:
Create the appropriate ALTER TABLE command which will not lose data.
[4 Dec 2009 12:30] Johannes Taxacher
this was fixed and included in 5.2.10
[8 Dec 2009 10:58] Tony Bedford
An entry has been added to the 5.2.10 changelog:

When using Alter Table in the SQL Editor, if a column name was changed, and the Apply button clicked, the Apply Object Changes wizard was launched. The Review changes page indicated that the script that would be applied would drop the altered column then add a new column with the new name. This led to column data being lost, as the script should instead have used CHANGE COLUMN, to change the name of the column.
[5 Mar 2010 7:04] Susanne Ebrecht
Bug #51726 is a regression of this bug here.
[12 Mar 2010 18:51] Johannes Taxacher
can't confirm the regression - not repeatable for me in current version