Bug #19935 Incorrect ENUM() fields default value export
Submitted: 19 May 2006 9:30 Modified: 19 Jun 2006 13:59
Reporter: Tema Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Preview Severity:S2 (Serious)
Version:1.0.6beta OS:Windows (Windows XP SP2)
Assigned to: Assigned Account CPU Architecture:Any

[19 May 2006 9:30] Tema
Description:
If I have ENUM() fields with default value, exporting to SQL create script is work incorrect. For example:

...
'status' ENUM('ACTIVE', 'BLOCKED') NOT NULL DEFAULT ACTIVE
...

As you can see, SQL generated without any quotes on default value.

How to repeat:
Just create a ENUM() field in table with default value and export model to SQL.

Suggested fix:
I'am not sure, because can't compile WB on Linux, but I think this bug is easy to fix with additional checking in

mysql-gui-common/library_grt_modules/source/myx_grt_mysql_transformation.c:563
[19 May 2006 12:31] MySQL Verification Team
Thank you for the bug report. Did you quoted the default value?

-- ----------------------------------------------------------------------
-- MySQL GRT Application
-- SQL Script
-- ----------------------------------------------------------------------

SET FOREIGN_KEY_CHECKS = 0;

CREATE DATABASE IF NOT EXISTS `test`
  CHARACTER SET latin1;
-- -------------------------------------
-- Tables

DROP TABLE IF EXISTS `test`.`table_01`;
CREATE TABLE `test`.`table_01` (
  `idtable_01` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `status` ENUM('BLOCKED','ACTIVE') NULL DEFAULT 'ACTIVE' AUTO_INCREMENT,
  PRIMARY KEY (`idtable_01`)
)
ENGINE = InnoDB
CHARACTER SET latin1 COLLATE latin1_swedish_ci;

SET FOREIGN_KEY_CHECKS = 1;

-- ----------------------------------------------------------------------
-- EOF

Thanks in advance.
[19 May 2006 12:34] MySQL Verification Team
I did the ENUM column as AUTO_INCREMENT, correct:

-- Tables

DROP TABLE IF EXISTS `test`.`table_01`;
CREATE TABLE `test`.`table_01` (
  `idtable_01` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `status` ENUM('BLOCKED','ACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`idtable_01`)
)
ENGINE = InnoDB
CHARACTER SET latin1 COLLATE latin1_swedish_ci;
[19 May 2006 13:59] MySQL Verification Team
Thank you for the feedback. I don't know if check syntax can be supported
in the currently stage and regarding the capital letters yes I think it is a
valid feature request.
[19 Jun 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".