Bug #17964 Adding a new MyIsam table to an empty model and synchronising filed
Submitted: 6 Mar 2006 14:08 Modified: 6 Mar 2006 17:41
Reporter: Stefaan Lesage (Basic Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Workbench Preview Severity:S2 (Serious)
Version:1.0.5 Beta OS:Windows (Windows XP/w2ksp4)
Assigned to: CPU Architecture:Any

[6 Mar 2006 14:08] Stefaan Lesage
Description:
I started with an empty model, and reverse engineered from an empty DB.  I then started creating a table, with lots of fields, including some VarChar fields.  When synchronsing with the DB the generated SQL Statement seemed to be incorrect :

CREATE TABLE `MyCatalog`.`T_ITEM` (
  `F_ITEM_ID` INT UNSIGNED NOT NULL,
  `F_ITEM_NAME01` VARCHAR(255) CHARACTER SET  COLLATE  NOT NULL,
  `F_ITEM_NAME02` VARCHAR(255) CHARACTER SET  COLLATE  NULL,
  `F_ITEM_NAME03` VARCHAR(255) CHARACTER SET  COLLATE  NULL,
  `F_ITEM_NAME04` VARCHAR(255) CHARACTER SET  COLLATE  NULL,

< snipped>

  PRIMARY KEY (`F_ITEM_ID`)
)
ENGINE = MyISAM
PACK_KEYS = DEFAULT
ROW_FORMAT = DYNAMIC
CHARACTER SET latin1 COLLATE swedish_ci;

I received the following error :

file c:\dokumente und einstellungen\mike\eigene dateien\work\mysql-gui-common\library_grt\source\myx_grt_value.c: line 3295: assertion `dict != NULL' failed
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE  NOT NULL,
  `F_ITEM_NAME02` VARCHAR(255) CHARACTER SET  COLLATE  NULL,' at line 3

Looks like it forgets to append the CHARACTER SET and COLLARION.

I tried copy / pasting the SQL command in the MySQL Query Browser, and after removing the CHARACTER SET  COLLATE from the VarChar fields, I also got an error about the collation which was incorrect, so I removed the CHARACTER SET latin1 COLLATE swedish_ci line as well and could complete the SQL command.

How to repeat:
New Model
Reverse Engineer Emtpy DB
Add MyIsam table
Generate some fields including some VARCHAR fields.
Try to apply the changes back to the DB.
[6 Mar 2006 14:17] Stefaan Lesage
Forgot to add up the Versin / OS
[6 Mar 2006 17:41] MySQL Verification Team
verifed exactly as described above.

Here's the output of the CREATE TABLE statement that failed

CREATE TABLE `emptydb`.`table_01` (
  `idtable_01` VARCHAR(25) CHARACTER SET  COLLATE  UNSIGNED NOT NULL AUTO_INCREMENT,
  `c2` CHAR(25) CHARACTER SET  COLLATE  NULL,
  PRIMARY KEY (`idtable_01`)
)
ENGINE = InnoDB
CHARACTER SET latin1 COLLATE latin1_swedish_ci;
[31 May 2006 13:48] Marcelo Rodrigo Wiebbelling
I'm using a latest version 1.0.6 beta and Windows XP SP2, the same problem appear to me.
[8 Aug 2006 4:30] Nathan Cole
What is that status of this... It's keeping me from being able to work with WorkBench effectively.

Thanks,
Nathan