Bug #33606 Exported SQL script has invalid format (create table with comment)
Submitted: 1 Jan 2008 16:22 Modified: 2 Jan 2008 17:40
Reporter: Guy van der Werf Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.11 OSS Beta (r2360) OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any

[1 Jan 2008 16:22] Guy van der Werf
Description:
2 tables related by a single foreign key were exported from the workbench using "File - Export - Forward Engineering SQL Script..".

Executing the resulting SQL script causes the following error when executed against MySQL 5.0.26 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''USR - Users registered in the application' at line 16

The tables included in the script have a table level comment. This error does not occur when the tables do not have table level comments.

How to repeat:
Any SQL script exported with a table level comment results in this error.

Suggested fix:
Workaround: Manually add the missing single quote at the end of the table comment.

Fix: Workbench should generate the script with the missing single quote as stipulated above (see workaround).
[1 Jan 2008 16:30] Guy van der Werf
BTW - I don't think it has an effect on the problem, but for completeness, the following options were used to generate the SQL script:
"Generate separate CREATE INDEX statements" and
"Generate SHOW WARNINGS after every DDL statement"
[1 Jan 2008 16:36] Guy van der Werf
Example of generated SQL script with invalid format

Attachment: example.sql (application/octet-stream, text), 2.37 KiB.

[2 Jan 2008 13:03] Johannes Taxacher
this bug is already filed as bug# http://bugs.mysql.com/bug.php?id=33603
[2 Jan 2008 17:40] Johannes Taxacher
works in SVN Rev 2364