Bug #43799 INSERTs creation when forward-engineering SQL doesn't work
Submitted: 23 Mar 2009 9:09 Modified: 3 Sep 2009 9:43
Reporter: Ronan Jouchet Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.1 OS:Windows (Windows XP SP3 x86, Ubuntu 8.10 x86)
Assigned to: CPU Architecture:Any
Tags: bug, export, SQL

[23 Mar 2009 9:09] Ronan Jouchet
Description:
Hello,

In Workbench 5.1.9 OSS Beta, the SQL-export feature no longer produces INSERTs statements when asked to. It used to work in 5.0.30 OSS GA.

Always reproducible under WinXP SP3 and Ubuntu 8.10, both 32bits.

Reported here after asking #workbench on IRC if the bug was known and being told that it's not.

-- Win32 system info --
MySQL Workbench SE for Windows version 5.1.9
Cairo Version: 1.5.12
Rendering Mode: GDI Rendering
OpenGL Driver Version: Not Detected
OS: Windows XP
CPU: 2x Intel(R) Core(TM)2 Duo CPU     T7100  @ 1.80GHz, 2.0 GB RAM
Video adapter info:
Adapter type: NVIDIA Quadro NVS 130M
Chip Type: Quadro NVS 130M
BIOS String: Version 60.86.49.00.26
Video Memory: 524288 KB

How to repeat:
1. Click on File> Export> Forward engineer SQL script
2. (--Optional-- Specify output file, and) at least check "Generate INSERT statements for tables"
3. Click on next, next
4. Preview the generated SQL, or actually generate and review it
[23 Mar 2009 11:41] Ronan Jouchet
To be totally clear, the produced sql file is ok on table-definition side (creation, indexes/keys definition), but has no INSERTs
[23 Mar 2009 12:02] MySQL Verification Team
Thank you for the bug report.
[23 Mar 2009 12:21] Susanne Ebrecht
Verified as described.
[25 Mar 2009 1:22] MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=43847 has been marked as duplicate of this one.
[12 Apr 2009 9:55] Ronan Jouchet
Still valid as of 5.1.10beta.
[27 Apr 2009 19:32] Ronan Jouchet
Still valid in MySQL Workbench 5.1.12 beta3 (2009-04-27).
[21 May 2009 22:24] frank yenshaw
I am using Ubuntu 8.04 and MySQL Workbench 5.1.12 and this problem still occurs.  Is there are solution in sight?

Thanks!
[24 May 2009 17:00] Alfredo Kojima
Did you enable the "Generate INSERT statements for Tables" option in the 1st page of the forward engineer wizard?
[24 May 2009 21:12] Ronan Jouchet
Alfredo: yes.
[28 May 2009 17:51] Alfredo Kojima
I can repeat with 5.1.12, but not with latest repository version.
[28 May 2009 18:39] Ronan Jouchet
Great news. I'll check the next alpha build.
[3 Jun 2009 17:31] Johannes Taxacher
fix confirmed. will be included in release 5.1.13
[10 Jun 2009 9:23] Tony Bedford
An entry was added to the 5.1.13 changelog:

The Forward Engineer SQL Script wizard did not emit table INSERT statements in the generated script when requested to do so.
[12 Jun 2009 22:35] Alexandre Duarte Rogoski
Stills valid on 5.1.13 for me.
[13 Jun 2009 10:26] Ronan Jouchet
OK for me on 5.1.13 under Ubuntu.

Alexandre,
Did you enable the "Generate INSERT statements for Tables" option in the 1st page of the forward engineer wizard?
[13 Jun 2009 12:03] Alexandre Duarte Rogoski
Yes, I've done that but **some** of my tables still not generating the statements.
[13 Jun 2009 12:49] Ronan Jouchet
Reopening.

Alexandre,
Could you precise your "some"? See any common point between the problematic tables?
[13 Jun 2009 14:05] Alexandre Duarte Rogoski
I tried to create a new model with some of the tables and the same options and it worked. I'm using this file since a long time ago, can't it be buggy?
[13 Jun 2009 14:38] Alexandre Duarte Rogoski
Created a new schema data, copied and pasted all tables and it worked...
Very wierd...
[13 Jun 2009 18:17] Valeriy Kravchuk
Please, send your problematic .mwb file.
[15 Jun 2009 14:16] Alexandre Duarte Rogoski
Attached yesterday as private. Did you saw it?
[15 Jun 2009 21:16] Mark M
The INSERTs work, except they don't use the fully qualified path name of the table (database.table), which presents a problem.  Since all the INSERTs are at the bottom of the script instead of following the table definition, it generates an error on import if you have multiple databases exported.
[15 Jun 2009 21:28] Alexandre Duarte Rogoski
Mark, this is not the problem being presented here. The model really do not generate the INSERT statements in the script.
[19 Jun 2009 15:13] Alexandre Duarte Rogoski
Can I provide any more information?
[1 Jul 2009 0:33] Alexandre Duarte Rogoski
Still the same on 5.1.16 GA.
[13 Jul 2009 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".
[15 Jul 2009 10:07] Richard Thompson
I've been experiencing this problem using MySQL Workbench OSS 5.1.16 (WinXP SP3), however it only seemed to affect some tables and not others.

After a bit of trial an error I beleive I've found that its caused by foregin key constaints - when a table with a foreign key is created (in the workbench) before the table which it references, any inserts in the table which it references are not output by the Forward Engineer... procedure.

Test (order is important):

Create table A (aid int primary key, adata varchar(255) not null);

Create table B (bid int primary key, bdata varchar(255) not null);

Modify table A adding a column which references B(bid).

Add some INSERTs to table B.

Try 'Forward Enigneer..' with Create INSERTSs selected - The INSERTs for B are missing.

Create table C (cid int primary key, cdata varchar(255) not null, bid int not null references B(bid))

Modify table A and remove the column which references B(bid).

Try 'Forward Engineer..' with Create INSERTs selected - The INSERTS for B are now correctly included.
[23 Jul 2009 11:14] MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=46345 marked as duplicate of this one.
[10 Aug 2009 15:50] MySQL Verification Team
See bug: http://bugs.mysql.com/bug.php?id=46621.
[11 Aug 2009 7:33] Susanne Ebrecht
Verified as described by using test from comment from:

[15 Jul 12:07] Richard Thompson
[11 Aug 2009 7:35] Susanne Ebrecht
Bug #46621 is marked as duplicate of this bug here.
[17 Aug 2009 2:40] Susanne Ebrecht
Bug #46722 is set as duplicate of this bug here.
[3 Sep 2009 9:43] Alexander Musienko
Duplicate of Bug #45920