Bug #35609 Forward Engineer Wizard fails to generate simple databases
Submitted: 27 Mar 2008 14:13 Modified: 28 Mar 2008 16:07
Reporter: Daniel Haas Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.16 RC OS:Windows (Vista)
Assigned to: Mike Lischke CPU Architecture:Any

[27 Mar 2008 14:13] Daniel Haas
Description:
When trying to forward engineer a database i freshly made, containing only 9 tables and some foreign key constraints, MySQL Workbench fails to generate working SQL code. (See screenshot attached)
The error is the well-known and dreaded
Error 1005: Can't create table '.\myproject\projects.frm' (errno: 121)
error.
I did not select any of the options on the first screen of the wizard, and the validation runs through without any problems.

How to repeat:
1. Load the attached file
2. Try to Forward Engineer the database using the wizard
3. Do not change any options, and just press Next on every page when possible. (Database password is needed, validation should be run)

Suggested fix:
Since this is one of the most basic and important features of MySQL Workbench, this should just work out of the box!
[27 Mar 2008 14:14] Daniel Haas
Screenshot showing the error in the wizard.

Attachment: forward-engineer-error121.png (image/png, text), 124.04 KiB.

[27 Mar 2008 14:14] Daniel Haas
The MWB-File that shows the error.

Attachment: MyProject-recovered.mwb (application/octet-stream, text), 11.96 KiB.

[27 Mar 2008 16:25] MySQL Verification Team
Thank you for the bug report.
[28 Mar 2008 13:36] Mike Lischke
I guess you know that duplicate key names lead to that error and that you have e.g. used 'customer' twice. So what exactly is this bug report about? You used an invalid schema design and tried to create a valid schema, that fails and you expected something different. What is it?

Btw, validation of MySQL specific things in the catalog fails in the dialog, it just does not show what failed. So this is a bug on its own.
[28 Mar 2008 14:53] Mike Lischke
Please ignore my sentence about the failing validation. I did not see your other bug report about this indicator (which leds to the assumption the validation would always fail).
[28 Mar 2008 15:36] Daniel Haas
To be honest I did not know that dupicate key name lead to such a behaviour. The MySQL Error was not really specific and I blindly supposed the error in another area. Sorry.

It would be great however, if the validation would check this and point out the duplicate use of key names. - Or even better: MySQL Workbench should prevent one to even create indexes with the same names.
Would that be doable?
[28 Mar 2008 16:07] Mike Lischke
Well, the duplication of key names is very specific to MySQL (and InnoDB) so it should be checked by the validation. What you could not know is that there is no validation check for this yet. We are right now working on that. Hence you have not been warned and thought your model would be fine. For more info about the error you get read here: http://forums.mysql.com/read.php?22,33999,76181#msg-76181.

Best regards and thanks for taking care to send in bug reports.