Open
Description
Error Report
Please answer the following questions before submitting your issue. Thanks!
- What is the URL/path of the document related to this issue?
https://docs.pingcap.com/tidb/stable/auto-increment#restrictions
- How would you like to improve it?
The behavior of auto-increment is engine specific in MySQL. Although the mysql-compatibility page already documents that engine=XX is ignored, it is worth adding a note to the auto-increment page under "restrictions" to state this.
Here is an example to show the behavior difference:
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)
) ENGINE=MyISAM;
INSERT INTO animals (grp,name) VALUES
('mammal','dog'),('mammal','cat'),
('bird','penguin'),('fish','lax'),('mammal','whale'),
('bird','ostrich');
SELECT * FROM animals ORDER BY grp,id;
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status