Bug #35691 Forward Engineer SQL ALTER Script generates statements even when no changes
Submitted: 31 Mar 2008 5:45 Modified: 1 Apr 2008 1:38
Reporter: Ng Derick Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.16 OS:Windows (XP)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[31 Mar 2008 5:45] Ng Derick
Description:
The "Forward Engineer SQL ALTER" feature generates ALTER script for tables where no changes are made.

E.g.

ALTER TABLE `my_db`.`tags` DROP PRIMARY KEY , ADD PRIMARY KEY (`id`) , DROP INDEX `unique_name` , ADD UNIQUE INDEX unique_name (`name` ASC) ;

How to repeat:
Simply create a new Workbench file, add two InnoDB tables where one reference the other. Generate an SQL CREATE script, save it. Then generate SQL ALTER script using the previously created file as input.
[31 Mar 2008 10:40] MySQL Verification Team
Thank you for the bug report.
[31 Mar 2008 15:43] Vladimir Kolesnikov
Hi,

I cannot repro the problem with the supplied steps. Can you please provide more details?
[1 Apr 2008 1:34] Ng Derick
Workbench file, CREATE and ALTER scripts

Attachment: bug-data-35691.zip (application/x-zip, text), 7.16 KiB.

[1 Apr 2008 1:38] Ng Derick
Please refer to the attached sample workbench file and the create/alter scripts generated.

sql-alter-bug-1.sql is the initial create script where there are only `users` and `posts` table.

sql-alter-bug-2.sql is the alter script generated after I have added the `files` table. You can see that there is an additional ALTER statement that does "nothing".

sql-alter-bug-3.sql is the create script generated to show that there are infact no changes from sql-alter-bug-1.sql

Either way, you can try to add another table to the workbench file and I suppose you would be able to further notice the error once the no. of tables increases. Thank you.