Bug #6533 Flaw in SQL command when adding Key to existing table that has no existing key.
Submitted: 9 Nov 2004 22:40 Modified: 13 Oct 2005 14:40
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Administrator Severity:S1 (Critical)
Version:1.0.14 OS:Windows (WinXP)
Assigned to: Mike Lischke CPU Architecture:Any

[9 Nov 2004 22:40] [ name withheld ]
Description:
Exported a table from Access to MySQL via ODBC connection.  The export from Access, evidently does not specify the indexes when transferring through ODBC. When going into MySQL Administrator to define a Primary Key, it chokes when executing the following SQL command.  

SQL command coming from MySQL Administrator:

ALTER TABLE `test`.`Products` MODIFY COLUMN `ProductID` INTEGER NOT NULL
, ADD PRIMARY KEY(`ProductID`)
, ADD PRIMARY KEY(`ProductID`);

Error received:

1068 - multiple primary key defined.

My SQL Administrator for some reason is trying to do the ADD PRIMARY KEY statement twice in the same SQL command.

How to repeat:
1.  Create a table in MySQL, but not within MySQL Administrator, with no primary keys, or indexes.  
2.  Try to use MySQL Administrator to create a primary key on the table you just created.
[12 Nov 2004 22:08] [ name withheld ]
mistake in marking version..changed from 1.014 to 1.0.14
[12 Nov 2004 22:11] [ name withheld ]
Changed Severity from Serious to Critical.
[13 Oct 2005 14:40] Mike Lischke
Cannot reproduce that problem. It is probably already fixed.