Bug #14419 query broswer generate a wrong sql source when creating a simple table
Submitted: 28 Oct 2005 9:04 Modified: 28 Oct 2005 9:42
Reporter: [ name withheld ] Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.17 OS:Windows (windows 2000)
Assigned to: CPU Architecture:Any

[28 Oct 2005 9:04] [ name withheld ]
Description:
query broswer generate a wrong sql source when creating a simple table by default

i'm using mysql 4.1.12

it's generate : 

CREATE TABLE `cgca`.`table` (
  `id` INTEGER UNSIGNED NOT NULL DEFAULT 0 AUTO_INCREMENT,
  `texte` VARCHAR(45) NOT NULL DEFAULT '',
  PRIMARY KEY(`id`)
)
ENGINE = MYISAM;

instead of : 

CREATE TABLE `cgca`.`table` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `texte` VARCHAR(45) NOT NULL DEFAULT '',
  PRIMARY KEY(`id`)
)
ENGINE = MYISAM;

How to repeat:
-> create new table
-> table in table name 
-> id in first column (let everything by default)
-> text in second colomun

then -> apply change
it show the wrong code, and execute of course will put an error.

Suggested fix:
a workaround is to put somthing (0) in default value
then, the script is correcltly generated
[28 Oct 2005 9:42] Valeriy Kravchuk
Thank you for a problem report. Worked as expected in 1.1.15, by the way. 

But, in fact, I think it is a duplicate of http://bugs.mysql.com/bug.php?id=14280 (the same bug in MySQL Administrator), because both these tools use the same dialog box for creating new tables.