pingcap / pingcap/docs

Auto-inc docs should describe behavior as InnoDB-like

Open
#7,515 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2024-tidb-docs-dash area/sql-infra tracked type/bugfix
Dominant language
Python
Stars
617
Forks
724
Avg merge
2d 10h
Merged PRs (30d)
223

Description

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;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked auto-increment documentation and its Restrictions section, then compare the existing mysql-compatibility page and the supplied SQL example. Done means the auto-increment page clearly notes the engine-specific behavior and its relationship to TiDB's compatibility behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, sql
Domain
databases, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.