Skip to content

Auto-inc docs should describe behavior as InnoDB-like #7515

Open
@morgo

Description

@morgo

Error Report

Please answer the following questions before submitting your issue. Thanks!

  1. What is the URL/path of the document related to this issue?

https://docs.pingcap.com/tidb/stable/auto-increment#restrictions

  1. 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

No one assigned

    Labels

    2024-tidb-docs-dashThis issue or PR is included in the 2024 TiDB Docs Dash event.area/sql-infraIndicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.trackedThis issue has been tracked.type/bugfixThis PR fixes a bug.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions