Bug #49682 SQL Export Options mixed up
Submitted: 14 Dec 2009 16:56 Modified: 9 Feb 2010 17:13
Reporter: Leif Inge Sandberg Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.10 OSS OS:Any
Assigned to: Alexander Musienko CPU Architecture:Any

[14 Dec 2009 16:56] Leif Inge Sandberg
Description:
Checking the option "Omit Schema Qualifier in Object Names" causes the Create Schema line to disappear from the export script. The Drop Schema line also is gone, no matter how hard I push the option "Generate DROP SCHEMA"... I want to omit schema qualifiers, but have to manually add Create Schema then.

Might be related to Bug #47969.

How to repeat:
Select File/Export/Forward Engineer SQL Script, give a file name and tick the "Omit Schema Qualifier in Object Names" checkbox. Click Next, Next, and in the preview window you see no Create Schema line.

Go Back, Back and un-tick the Omit Schema Qualifier checkbox. Click Next, Next, and voila - the Create Schema line is there.

Suggested fix:
I think there should always be a Create Schema line in the export script. If it should be optional, at least make a separate checkbox to remove it, not use the Omit Schema Qualifier.
[15 Dec 2009 9:57] Leif Inge Sandberg
When the Omit Schema Qualifier checkbox is ticked, Workbench must of course add a "use <schema>" line after Create schema. Actually, that line could always be added to the export script, right?
[8 Feb 2010 18:02] Johannes Taxacher
fixed in repository
[9 Feb 2010 17:13] Tony Bedford
An entry has been added to the 5.2.16 changelog:

In the Forward Engineer SQL Script wizard, selecting the checkbox Omit Schema Qualifier in Object Names caused the CREATE SCHEMA statement to be removed. DROP SCHEMA statements were also removed, even if the Generate DROP SCHEMA checkbox was selected.

MySQL Workbench has been changed so that if the Omit Schema Qualifier in Object Names checkbox is selected, it is possible to optionally select the checkbox Insert USE Statements, to enable or disable the use of USE statements.