Bug #47379 After changing Datatype INT to VARCHAR, the Auto-incremental Flag is checked
Submitted: 16 Sep 2009 15:28 Modified: 30 Jul 2013 18:47
Reporter: arnaud lemercier Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.1.18 OS:Any (XP SP3, Mac OS X)
Assigned to: CPU Architecture:Any
Tags: ai, Auto-incremental

[16 Sep 2009 15:28] arnaud lemercier
Description:
When you change the INT Datatype to VARCHAR. AI attribut is checked

How to repeat:
1 - Create a new table "Exemple"
2 - Create a INT column "idExemple" with PK, NN and AI attributs
3 - Change the datatype to VARCHAR(45)

Suggested fix:
Unchecked AI when datatype change to non auto incremental type
[16 Sep 2009 15:31] arnaud lemercier
Example MySQL Workbench File

Attachment: BUG_47379.mwb (, text), 3.61 KiB.

[16 Sep 2009 15:43] Valeriy Kravchuk
Verified just as described on Mac OS X.

Note that while flag is set, Forward Engineer SQL Create Script... generates SQL correctly, like this:

CREATE  TABLE IF NOT EXISTS `mydb`.`table1` (
  `c1` VARCHAR(10) NOT NULL ,
  `c2` VARCHAR(45) NULL ,
  PRIMARY KEY (`c1`) )
ENGINE = InnoDB;
[30 Jul 2013 18:47] Philip Olson
Fixed as of MySQL Workbench 6.0.4, and here's the changelog entry:

Changing the "INTEGER" data type to "VARCHAR" would leave the "AI"
("AUTO_INCREMENT") attribute checked.

Thank you for the bug report.