Bug #35947 "Export" => "Forward Engineer SQL Create Script" creates wrong SQL Syntax
Submitted: 9 Apr 2008 19:15 Modified: 27 Nov 2009 11:11
Reporter: Dennis Becker Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.17a OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any
Tags: CREATE SQL script, innodb, myisam, references

[9 Apr 2008 19:15] Dennis Becker
Description:
I have started to create a database scheme with version 5.0.14 of Workbench. After creating some tables, I found out that the DB scheme is set to InnoDB, so switched to MyISAM. I also added Foreign Key references and also checked the column in the referenced table and also checked the ER-Model every time (always let Workbench recreate it with the the tool under "Model" => "Create Diagram from Catalog Objects". Everything looked good. After finishing the first milestone, I exported an SQL Create Script with "Export" => "Forward Engineer SQL  Create Script". I opened the *.sql file and with copy & paste I added it to the SQL-textarea of phpMyAdmin. When I now startet to recreate the database tables, I got a lot of errors, which you could see in my attachements of wront SQL.

Here are some rewritten examples of errors:
CREATE  TABLE IF NOT EXISTS `mydb`.`table` (
  `name` VARCHAR(45) NOT NULL AUTO_INCREMENT ,
  `hint` VARCHAR(45) NULL ,
  `description` TEXT NULL ,
  PRIMARY KEY (`name`) ,
  CONSTRAINT ``
    FOREIGN KEY ()
    REFERENCES `` ()
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = MyISAM;

CREATE INDEX  ON `mydb`.`table` () ;

How to repeat:
Not sure, but start a new DB Scheme, add some tables and references, change from InnoDB to MyISAM, add some more tables and then export a SQL create script and check that script in MySQL.
[10 Apr 2008 8:00] Maksym Yehorov
Check for AUTO columns and non-numeric types added.
[16 Apr 2008 13:09] Johannes Taxacher
problems resolved (but only SE Version reports errors in model)
[11 May 2008 1:09] Paul DuBois
Not sure how to describe the problem. Can you suggest a sentence for the changelog entry? Also need the revision number for the fix. Thanks.
[29 Oct 2009 9:31] Dennis Becker
This bug has been fixed but the issue is still open?
[27 Nov 2009 10:03] Johannes Taxacher
was fixed in version 5.0.21
[27 Nov 2009 11:11] Tony Bedford
An entry has been added to the 5.0.21 changelog:

When a schema used InnoDB, and then was switched to use MyISAM, the script generated by Forward Engineer SQL CREATE Script still contained InnoDB-only syntax.