Skip to content

need to clarify the example in AUTO_RANDOM #20732

@hfxsd

Description

@hfxsd

Error Report

Feedback in Chinese:

https://docs.pingcap.com/tidb/stable/auto-random/#user-scenario 文档中的代码示例存在误导,执行ALTER TABLE t AUTO_RANDOM_BASE=0;后确实会输出Can't reset AUTO_INCREMENT to 0 without FORCE option, using xxxx instead,但这并没有起效。需要使用force关键字执行设置,但直觉会让我参考ALTER TABLE t AUTO_RANDOM_BASE=0;就会去执行ALTER TABLE t force AUTO_RANDOM_BASE=0;又会报错不能将下一个ID设置为0。探索后发现需要设置成非0数字。

English translation:

In this doc, https://docs.pingcap.com/tidb/stable/auto-random/#user-scenario, the code example is misleading. After executing ALTER TABLE t AUTO_RANDOM_BASE=0;, it does output Can't reset AUTO_INCREMENT to 0 without FORCE option, using xxxx instead, but the setting does not actually take effect. You need to use the FORCE keyword to apply the change. However, intuitively, referencing ALTER TABLE t AUTO_RANDOM_BASE=0; might lead one to try ALTER TABLE t FORCE AUTO_RANDOM_BASE=0;, which results in an error saying that the next ID cannot be set to 0. After some exploration, I found that it must be set to a non-zero number.

We need to clarify that in the doc.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions