Bug #6471 auto_increment example with groups just does not work any more!
Submitted: 5 Nov 2004 21:23 Modified: 5 Nov 2004 23:22
Reporter: Mircea LUTIC Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.1.7 OS:Windows (winxp)
Assigned to: CPU Architecture:Any

[5 Nov 2004 21:23] Mircea LUTIC
Description:
The auto_increment example with groups just does not work any more!
Id used to. Now I got 4.1.7 it doesn't work any more.
I just happen to need this exact thing.

mysql> CREATE TABLE animals (
    ->              grp ENUM('fish','mammal','bird') NOT NULL,
    ->              id MEDIUMINT NOT NULL AUTO_INCREMENT,
    ->              name CHAR(30) NOT NULL,
    ->              PRIMARY KEY (grp,id)
    ->              );
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

How to repeat:
I just copied the example in the doc & pasted it into mysql cmd line.

Suggested fix:
make it work...
[5 Nov 2004 22:00] Mircea LUTIC
I just noticed this does not happen for type=myisam;
It may depend on the storage engine.
[5 Nov 2004 22:02] Mircea LUTIC
I re-read the doc and it says indeed that this only works for MyISAM and BDB tables.

I have been playing with memory tables (never did that before).

Sorry.
[5 Nov 2004 23:22] Paul DuBois
Closed per poster report.