Bug #78505 Generates invalid CREATE TABLE code for version 5.1 target
Submitted: 21 Sep 2015 17:45 Modified: 22 Sep 2015 4:10
Reporter: Jeff Kopmanis Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S1 (Critical)
Version:6.3.4 OS:MacOS (OS X 10.10.x Yosemite)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[21 Sep 2015 17:45] Jeff Kopmanis
Description:
----[For better reports, please attach the log file after submitting. You can find it in /Users/kopmanis/Library/Application Support/MySQL/Workbench/log/wb.log]

I'm using the EER Diagram functionality to create my schema, and when I Forward Engineer it to a MySQL 5.1.73 server, it fails with a 1064 error due to COMMENT statements that are put in the PRIMARY KEY and CREATE INDEX clauses.  This same functionality works fine on MySQL 5.5.44.  Additionally, the 5.1 does not accept duplicate foreign key names, while 5.5.44 had no trouble...this could be part of the same problem.

I have set the desired target to be MySQL 5.1 with the same results.

How to repeat:
Load Refresh_DB_Model.mwb and Forward Engineer with a MySQL 5.1.x server as the target, and proceed through the dialog.  The server will not accept the COMMENT statements in the PRIMARY KEY and CREATE INDEX clauses, and will detect duplicate foreign key names (even though in different tables).  Once corrections are made to the generated SQL, it will get through and create things properly.

Suggested fix:
Adjust the generated SQL to NOT include COMMENTs where they are not accepted.  Take away the SQL version preference, since it doesn't seem to affect what code is generated.
[21 Sep 2015 17:46] Jeff Kopmanis
The model that produces the problem

Attachment: Refresh_DB_Model.mwb (application/octet-stream, text), 21.78 KiB.

[21 Sep 2015 17:46] Jeff Kopmanis
The recommended log from Workbench

Attachment: wb.log (application/octet-stream, text), 3.84 KiB.

[22 Sep 2015 4:10] MySQL Verification Team
Hello Jeff Kopmanis,

Thank you for the report.
This is most likely duplicate of Bug #77910, please see Bug #77910

Thanks,
Umesh