Bug #1017 Auto-increment column

Submitted: 9 Aug 2003 10:13 Modified: 11 Aug 2003 2:09
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:4.0.13 OS:Linux (Linux)
Assigned to: Heikki Tuuri CPU Architecture:Any

[9 Aug 2003 10:13] [ name withheld ]
Description:
It appears InnoDB can not have an auto-increment column when the 
unique index contains two columns and the auto-increment coumn is the 
second part of the index.

This works fine in MyISAM, but InnoDB returns the error "ERROR 1075: 
Incorrect table definition; There can only be one auto column and it must 
be defined as a key"

How to repeat:
CREATE TABLE `testing` (
  `a` tinyint(4) NOT NULL default '0',
  `b` tinyint(4) NOT NULL auto_increment,
  `c` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`a`,`b`)
) TYPE=MyISAM;

Then try changing the type to innodb.

Suggested fix:
I am not sure wether this is a bug or a special case that the manual 
seems to skip over.

If this isn't a bug then it is a feature request.
[11 Aug 2003 2:09] Alexander Keremidarski
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

From InnoDB manual as found at: 
http://www.innodb.com/ibman.html

14 Restrictions on InnoDB tables

...

* For an AUTO_INCREMENT column one must always define a key to the table, and that key must contain just the auto-increment column.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.