Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: v7.5.1 AUTO_RANDOM(5, 54) id长度限制失效

[TiDB Usage Environment] Production Environment
[TiDB Version] 7.5.1
[Encountered Issue: Problem Phenomenon and Impact]
Setting the id length for a new table according to the official documentation
Table creation SQL
CREATE TABLE
middle_data_salesman
(
id
bigint(11) NOT NULL /*T![auto_rand] AUTO_RANDOM(5, 54) */ COMMENT ‘Primary key id’,
promote_platform_type
int(5) NOT NULL COMMENT ‘Third-party promotion platform type: 1 Douyin, 2 Youzan, 3 Kuaishou, 6 Video Account’,
relate_institution_id
varchar(100) NOT NULL COMMENT ‘Third-party institution ID.’,
relate_institution_name
varchar(100) DEFAULT NULL COMMENT ‘Third-party institution name.’,
role_type
varchar(50) DEFAULT NULL COMMENT ‘Third-party role: leader is the group leader backend, mcn is the MCN backend, dk is the Douke backend, shop is the merchant backend, salesman is the influencer backend.’,
module_type
varchar(50) DEFAULT NULL COMMENT ‘Module type: main is the main domain (most modules), finance is the financial domain (financial module).’,
task_type
int(5) NOT NULL COMMENT ‘Task type: 1 influencer public pool, 2 group leader public pool, 3 merchant public pool, 4 MCN, 10000 general task’,
task_fast_flag
int(5) NOT NULL COMMENT ‘Task mode: 1 normal, 2 key, 3 real-time’,
task_param
text NOT NULL COMMENT ‘Task parameters: influencer public pool is Douyin ID, general task is URL + header + post parameters’,
task_status
int(5) NOT NULL DEFAULT ‘0’ COMMENT ‘Task status: 0 not executed, 1 executing, 2 completed, 3 abandoned (timeout)’,
get_task_time
datetime DEFAULT NULL COMMENT ‘Task acquisition time’,
finish_task_time
datetime DEFAULT NULL COMMENT ‘Task completion time’,
task_result
longtext DEFAULT NULL COMMENT ‘Task content’,
create_time
datetime NOT NULL COMMENT ‘Creation time’,
PRIMARY KEY (id
) /*T![clustered_index] CLUSTERED */,
KEYidx_task_create_time
(create_time
),
KEYidx_tastat
(task_status
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![auto_rand_base] AUTO_RANDOM_BASE=150001 */ COMMENT=‘Data module_crawler task table’
Result