Bug #33244 Creating SQL shows problem with Column Flags on wrong types
Submitted: 14 Dec 2007 14:25 Modified: 8 Jan 2008 13:29
Reporter: Mike Willbanks Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.10 SE Beta OS:Windows (XP SP2)
Assigned to: Assigned Account CPU Architecture:Any
Tags: column flags, create sql

[14 Dec 2007 14:25] Mike Willbanks
Description:
When you create a column, say an int datatype and check the unsigned flag and then later change that column to a varchar column (without first unchecking unsigned in the flags) then go to create sql you will get something like the following sql (cut out lines that didn't matter):

"CREATE  TABLE IF NOT EXISTS `mydb`.`table1` (`table1_id` VARCHAR(50) UNSIGNED NOT NULL , PRIMARY KEY (`table1_id`) ) ;"

How to repeat:
1. Create an EER Diagram
2. Create a table
3. For the first column specify it as an INT and then click the UNSIGNED flag
4. Change the column datatype to a VARCHAR 
5. Go to File -> Export -> Forward Engineer SQL Create Script

Suggested fix:
When a datatype is changed, it should ensure that only flags that are allowed on that datatype are set. If not, unset the flag.
[8 Jan 2008 13:29] Vladimir Kolesnikov
a duplicate of http://bugs.mysql.com/bug.php?id=33026