Bug #33706 Error with Default Values
Submitted: 5 Jan 2008 18:09 Modified: 7 Feb 2008 10:01
Reporter: Rafael Vieira de Araujo Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.0.11 SE rev2343 OS:Windows (XP Professional)
Assigned to: CPU Architecture:Any

[5 Jan 2008 18:09] Rafael Vieira de Araujo
Description:
When you use the Foward Enginner to SQL Script or Foward Enginner Database Schema and any table have a column with datatype Varchar and the Default Value is a string, the error occurs:
#1064 - 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 'A ,
  PRIMARY KEY (`idcustomers`) )' at line 4

This is script wich was generated:
CREATE  TABLE IF NOT EXISTS `mydb`.`customers` (
  `idcustomers` INT NOT NULL ,
  `name` VARCHAR(45) NULL ,
  `status` VARCHAR(1) NOT NULL DEFAULT A ,
  PRIMARY KEY (`idcustomers`) );

How to repeat:
1. Create a table with a column (type varchar)where default value is a String
2. Choose menu "Database" --> "Foward Engineer"
3. Select the table was created
4. Press Next button
5. Press Next button again 

Suggested fix:
Generate the Default value between simple quotes:

example:
CREATE  TABLE IF NOT EXISTS `mydb`.`customers` (
  `idcustomers` INT NOT NULL ,
  `name` VARCHAR(45) NULL ,
  `status` VARCHAR(1) NOT NULL DEFAULT 'A' ,
  PRIMARY KEY (`idcustomers`) );
[7 Jan 2008 10:01] MySQL Verification Team
Thank you for the bug report. I tried your sample table script and I wasn't
able to repeat. Could you please attach a picture showing the behavior reported.
Thanks in advance.
[8 Feb 2008 0: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".