Bug #18844 File > Export > Export SQL Create Script yields bogus code
Submitted: 6 Apr 2006 12:26 Modified: 16 Apr 2006 15:31
Reporter: Roland Bouman Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Preview Severity:S1 (Critical)
Version:1.0.5 beta OS:Microsoft Windows (WinXP Pro Sp2)
Assigned to: MySQL Verification Team CPU Architecture:Any

[6 Apr 2006 12:26] Roland Bouman
Description:
A very simple model of two tables that reference each other fails to be exported in SQL format. An SQL file is created, but it contains only bogus code.

I have been able to export SQL successfully with the Sakila example model 

How to repeat:
1) Open the workbench. 
2) Create a new table, name it: 'organization', add an column named 'id' (it is automatically created as primary key)
3) Create another table, name it: 'organization_office' add an column name id (it is automatically created as primary key).
4) Select the 1:n relationship tool, click the organization table and drag to the organization_office table. Click. A foreign key definition is created in the organization_office table (although the cardinality indicators are displayed the wrong way around - reported that already - not an issue here.)
5) Select the 1:n relationship tool, click the organization_office table and drag to the organization table. Click. A foreign key definition is created in the organization table 
6) save the model
7) from the menu, choose: File > Export > Export SQL Create script, and save at a location. 

Now, it was expected that the file would create two create table statements and some alter table add constraint statements. It does not. Instead, it contains this: 

 ¦-

`

d

T

o

-

Suggested fix:
LOL! export, uhm...SQL
[6 Apr 2006 12:27] Roland Bouman
The model from which the export is attempted

Attachment: t.mwb (application/octet-stream, text), 35.65 KiB.

[6 Apr 2006 12:27] Roland Bouman
The generated, uhm..SQL

Attachment: Creates.sql (application/octet-stream, text), 2.66 KiB.

[6 Apr 2006 16:26] MySQL Verification Team
Thank you for the bug report. I was unable to find what you mentioned
below:

It does not. Instead, it contains
this: 

 ¦-

`

d

T

o

Can you clarify what you meant. Thanks in advance.
[6 Apr 2006 17:12] Roland Bouman
I did attach the relevant files - did you check those out?
[16 Apr 2006 14:51] MySQL Verification Team
Roland,

The .sql file you attached is correctly generated. The one at http://bugs.mysql.com/file.php?id=3288.  Please, use a text editor (wordpad) to view it.  There's nothing amiss there, as far as I can tell.
[16 Apr 2006 15:31] Roland Bouman
Yes - indeed...it seems the editor I was using choked on it. Notepad does not have any problems with it.

I regret to've bothered you all, my apologies.

kind regards Roland