Bug #53068 Database > Forward Engineer to Database > Create no SQL Code
Submitted: 22 Apr 2010 14:51 Modified: 11 May 2010 15:16
Reporter: Michael Schramm Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.19 beta OS:Windows (Windows7, XP)
Assigned to: Alexander Musienko CPU Architecture:Any
Tags: forward engineer, sql code not generated

[22 Apr 2010 14:51] Michael Schramm
Description:
I have often the Problem that no SQL Code is geenrated while forward engineering even if i wait long for generated code.

Maybe its only with large databases? This database consist of nearly 100 Tables

How to repeat:
Create your Databasemodell in EER

select in top navigation :

database
->Forward Engineer
 move on with next till "Review SQL Script"

I selected the Database tables for export but the windows just generates the following code: (If i step several times forward (with next) to "connection options" and then back to "Review SQL Script" it shows correct generated SQL Code)

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
;

DELIMITER $$

DELIMITER ;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
[22 Apr 2010 14:55] Valeriy Kravchuk
Can you upload any .mwb file that demonstrates this problem?
[22 Apr 2010 15:01] Michael Schramm
i think i found the aktion that causes this Problem.

Before i started the forward engineering i changed the database name under the menue "Physical Schemata" -> "MYSQL Schema" -> name
[23 Apr 2010 8:47] Valeriy Kravchuk
Verified just as described in the last comment. Forward engineer any model to create objects in the database, then rename database and try to forward engineer again. Weird SQL that does actually nothing is generated.
[27 Apr 2010 1:37] Johannes Taxacher
as workaround you can click [back] and [next] to get the code generated
[10 May 2010 19:05] Johannes Taxacher
fix confirmed in repository
[11 May 2010 15:16] Tony Bedford
An entry has been added to the 5.2.21 changelog:

If a model was forward engineered to a database, renamed, and then forward engineered again, the SQL that was generated was erroneous.