pingcap/docs-cn

auto_random(5,54) 超出分配范围

GuangjieLiao opened this issue · 2 comments

File: /release-6.5/auto-random.md
image
如官网所述,AUTO_RANDOM(5, 54) 代替 AUTO_RANDOM(5),使得 TiDB 不会分配出大于 9007199254740991 (2^53-1) 的整数。

版本:5.7.25-TiDB-v6.5.0
我们的表结构:
image
CREATE TABLE xxxxxxx_record (
id bigint(20) unsigned NOT NULL /*T![auto_rand] AUTO_RANDOM(5, 54) */ COMMENT '主键id',
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![auto_rand_base] AUTO_RANDOM_BASE=59350326110818 */ COMMENT='测试表'

测试插入后:
image
9007199254741021
9007199254741024
9007199254741033
9007199254741162
9007199254741166
9007199254741243
9007199254741282
结果:生成数据很多都是大于9007199254740991 (2^53-1) 数据

期待回复感谢

@tangenta, PTAL, thanks

Hi @GuangjieLiao, just let you know that #17908 has been created to fix this issue you mentioned.