Bug #5774 Invalid SQL syntax for deleting auto_increment attribute.
Submitted: 27 Sep 2004 18:59 Modified: 3 Nov 2004 13:34
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.0.7-beta OS:Windows (Win XP / SP2)
Assigned to: CPU Architecture:Any

[27 Sep 2004 18:59] Shuichi Tamagawa
Description:
When deleting AUTO_INCREMENT attribute in the Table Editor, invalid SQL is produced.

ALTER TABLE `test`.`t1` MODIFY COLUMN `a` INTEGER UNSIGNED NOT NULL
, DROP INDEX `PRIMARY`
, AUTO_INCREMENT = NULL
CHARACTER SET 
ROW_FORMAT = DEFAULT;

How to repeat:
Create a table in the Table Editor which corresponds to

CREATE TABLE `test`.`t1` (
  `a` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
);

In the 'Column and Indices' tab, uncheck the 'AUTO INC' attribute.
Click 'Apply Changes'
Click 'Execute'
Fails with an error no. 1064.

Suggested fix:
The SQL should be

ALTER TABLE `test`.`t1` MODIFY COLUMN `a` INTEGER UNSIGNED NOT NULL;
[3 Nov 2004 13:34] Michael G. Zinner
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/