-
Notifications
You must be signed in to change notification settings - Fork 703
Description
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.