Bug #14605 Creating Primary Key and AUTO_INCREMENT assumes default value....and FAILS
Submitted: 3 Nov 2005 13:44 Modified: 3 Jan 2006 13:53
Reporter: Daniel Fiske Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.1.4 on 5.0.14 OS:Windows (Windows XP SP2)
Assigned to: Mike Lischke CPU Architecture:Any

[3 Nov 2005 13:44] Daniel Fiske
Description:
When creating a table using MySQL Administrator, the UI assumes that the default values of numerical values should have a value of 0 with primary key columns that are AUTO_INCREMENT it causes the create to fail.

It would try to create as follows

CREATE TABLE `test`.`SomeTest` (
  `ID` INTEGER UNSIGNED NOT NULL DEFAULT 0 AUTO_INCREMENT,
  PRIMARY KEY(`ID`)
)
ENGINE = InnoDB;

Which will fail.

It should not assume Default 0

How to repeat:
Using MySQL Administrator

1. Create a table called "test"
2. Add a column called "ID"
3. Set as Primary Key
4. Click Apply Changes->Execute

Suggested fix:
On primary keys with auto_increment DO NOT assume a default value.
[3 Jan 2006 13:53] Mike Lischke
Duplicate of #14280