Bug #58441 User Defined type flags are repeated in the exported SQL
Submitted: 24 Nov 2010 4:20 Modified: 25 Nov 2010 4:25
Reporter: Jose Xavier Email Updates:
Status: Closed Impact on me:
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.2.30 OS:Microsoft Windows (XP)
Assigned to: CPU Architecture:Any
Tags: Data Type, flags, User Defined

[24 Nov 2010 4:20] Jose Xavier
When SQL is generated using Plugins->Utilities->Export SQL, the flags defined as part of a user defined data type is repeated in the generated SQL.

How to repeat:
Create a user defined data type: Model-> User Defined Types:
Name: my_unique_id
Type: INT
Arguments: 11
Flags: UNSIGNED (checked)

Add a new table to a diagram. sample_table
Add a new column, column_1 to the table and choose my_unique_id as the data type. 
UN flag should be automatically checked.

Now export SQL using: Plugins->Utilities->Export SQL
Explorted SQL:
CREATE  TABLE IF NOT EXISTS `sample_table` (
  PRIMARY KEY (`column_1`) )

Suggested fix:
Remove the repeated UNSIGNED flag from the exported sql when it is also defined in the user defined type
[24 Nov 2010 7:15] Valeriy Kravchuk
What edition do you use? I do not have Plugins->Utilities->Export SQL item in default installation of 5.2.30 CE.
[25 Nov 2010 3:33] Jose Xavier
I use: MySQL Workbench 5.2.30 CE Revision 6790
( mysql-workbench-gpl-5.2.30-win32-noinstall.zip )
[25 Nov 2010 4:24] Jose Xavier
This was caused by a left over script from the previous version installation which did not export user defined data type flags
[25 Nov 2010 4:25] Jose Xavier