Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
5.5, 10.0, 10.1, 10.2
-
None
Description
This script:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a CHAR(20) NOT NULL, b INT NOT NULL AUTO_INCREMENT, INDEX(a,b)) ENGINE=InnoDB; |
correctly return an error:
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
|
If I now change ENGINE to MyISAM, it creates the table with no errors:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a CHAR(20) NOT NULL, b INT NOT NULL AUTO_INCREMENT, INDEX(a,b)) ENGINE=MyISAM;
|
INSERT INTO t1 (a) VALUES ('a'),('b'),('c');
|
SELECT * FROM t1;
|
but AUTO_INCREMENT does not actually work:
+---+---+
|
| a | b |
|
+---+---+
|
| a | 1 |
|
| b | 1 |
|
| c | 1 |
|
+---+---+
|
The problem seems to be introduced by:
Author: unknown <monty@mashka.mysql.fi> 2003-03-07 14:36:52
|
Committer: unknown <monty@mashka.mysql.fi> 2003-03-07 14:36:52
|
 |
Fixed AUTO_INCREMENT handling in MyISAM (last auto_increment patch broke things)
|
Some after merge fixes
|