Bug #50323 User Types incomplete
Submitted: 14 Jan 2010 9:57 Modified: 10 May 2010 12:32
Reporter: Philippe LECLERCQ Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:5.1.18 OSS OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: flags, UNSIGNED, user types, ZEROFILL

[14 Jan 2010 9:57] Philippe LECLERCQ
Description:
I defined a user type with the dialog box "Model" > "User Defined Types..." as :
INTID smallint(6)UNSIGNED and use it for each table with a primary or foreign key where this applies.
But the SQL create script generated is as follows :
CREATE  TABLE IF NOT EXISTS `gestion`.`fonctions` (
  `id` SMALLINT(6) NOT NULL AUTO_INCREMENT ,
  `libelle` VARCHAR(255) NOT NULL DEFAULT '' ,
  `display_order` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB
AUTO_INCREMENT = 11;

I.E. UNSIGNED is not figuring in the `id` field definition.
So, i checked the zerofill checkbox to see if it was similar and it is.
Whenever, on the right pane of WB showing the user types, UNSIGNED is present.

How to repeat:
1/ Create a user defined type like INTID smallint(6), check the checkboxes Unsigned and/or Zerofill

2/ create a table with a field id of type INTID

3/ Use File > Export > Forward engineeer SQL Create script and look at the script generated. The SQL Create table statement will be :
CREATE  TABLE IF NOT EXISTS `mydb`.`table1` (
  `id` INT(6) NOT NULL ,
  PRIMARY KEY (`id`) )
ENGINE = InnoDB;
[14 Jan 2010 13:03] Johannes Taxacher
verified with current branch of 5.2 as well
[1 May 2010 2:22] Alfredo Kojima
Cannot repeat with current 5.2 version
[6 May 2010 9:31] Johannes Taxacher
confirm fixed in repository
[10 May 2010 12:32] Tony Bedford
An entry has been added to the 5.2.21 changelog:

In the User Defined Types dialog, launched using the main menu item Model, User Defined Types, selection of the UNSIGNED or ZEROFILL checkboxes was not reflected in SQL code generated by the Forward Engineer SQL Script wizard.