Bug #33454 Forward Engineer creates non-sql statements
Submitted: 21 Dec 2007 10:15 Modified: 24 May 2008 15:26
Reporter: Daniel Haas Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.11a OS:Windows (Vista)
Assigned to: Assigned Account CPU Architecture:Any

[21 Dec 2007 10:15] Daniel Haas
Description:
After the sql to create a table the lines
PACK_KEYS = 0
ROW_FORAMT = 0
are appended to the table definition.

Example:
CREATE  TABLE IF NOT EXISTS `mydb`.`customers` (
  `id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  `name` VARCHAR(128) NOT NULL ,
  `street` VARCHAR(128) NOT NULL ,
  `city` VARCHAR(128) NOT NULL ,
  `zip` INT NOT NULL ,
  `country` VARCHAR(128) NULL ,
  `telephone` VARCHAR(45) NULL ,
  `fax` VARCHAR(45) NULL ,
  PRIMARY KEY (`id`) )
PACK_KEYS = 0
ROW_FORMAT = 0

When trying to create the tables the following error shows up:
Error 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 '0' at line 13

However this does not happen on all tables i have in the schema. A table which i added later to the schema, does not generate those two lines.

When manually removing the two lines I get another error when trying to run the script, because the ; at the end of the create table definition is missing.

When adding the ; it mostly works, but bails out due to foreign key constraints (errno 150), but thats another bug...

How to repeat:
I dont know how exactly to trigger this problem.
To test it, I will attach the file which is causing this behaviour.
Then just run the forward engineer wizard and see what happens.

Suggested fix:
The Forward Engeneer Wizard should create runnable SQL code.
[21 Dec 2007 10:16] Daniel Haas
MySQL Workbench file that triggers the behaviour

Attachment: forward-engineer-bugs.mwb (application/octet-stream, text), 13.76 KiB.

[11 Jan 2008 15:34] Vladimir Kolesnikov
The problem is actually not with SQL export functionality. Somehow wrong values were assigned to table properties. Can you try to reproduce the sequence of actions, starting with a new table creation which leads to this behavior. It's quite possible that the problem is in the table editor or in some other component that modifies table objects.
[12 Feb 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[7 Apr 2008 9:34] Daniel Haas
I have now verified this problem again.
The file I work with, was imported from DBDesigner4 and i assume that the values come from a faulty import or a faulty DBDesigner4 file.
The value shown in the table editor is "Pack None", when trying to forward engineer that, it produces the above mentioned statements.
The real problem however is, that one cannot change the Pack Keys value. I opened another bug for this problem: http://bugs.mysql.com/bug.php?id=35872
[24 Apr 2008 15:26] MySQL Verification Team
Thank you for the feedback. So this bug report is related to bug http://bugs.mysql.com/bug.php?id=35872?. Thanks in advance.
[24 May 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".