Bug #51719 When altering a table previously applied SQL is mingled with new SQL
Submitted: 4 Mar 2010 13:33 Modified: 30 Mar 2010 20:19
Reporter: Richard Davies Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S2 (Serious)
Version:5.2.16 Beta OS:Any (Windows 7 x64, Mac OS X)
Assigned to: Assigned Account CPU Architecture:Any

[4 Mar 2010 13:33] Richard Davies
Description:
Bug occurs when using the alter table dialog:

SQL Editor tab -> object explorer -> database -> table, and the by right-clicking a table and selecting 'Alter table'.

The following is a specific example of a generic bug:

If I add a new column foo through this gui and then apply, the following SQL is generated and a new column added:

ALTER TABLE `shop`.`stock` ADD COLUMN `foo` VARCHAR(45) NULL  AFTER `heh` ;

If I then immediately add another column bar through this gui then apply, I get the following SQL:

ALTER TABLE `shop`.`stock` ADD COLUMN `foo` VARCHAR(45) NULL  AFTER `heh` , ADD COLUMN `bar` VARCHAR(45) NULL  AFTER `foo` ;

The generic description would be that the previous SQL instruction, although already applied, is not flushed from memory and is integrated with any subsequent new SQL instruction, for the duration that the table editor dialog is open.

How to repeat:
Just attempt to apply any two subsequent SQL instructions that alter the structure of a table.
[4 Mar 2010 17:08] Valeriy Kravchuk
Thank you for the bug report. Verified just as described on Mac OS X.
[30 Mar 2010 20:19] Johannes Taxacher
this is actually a duplicate of Bug #51516