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(
idbigint(11) NOT NULL /*T![auto_rand] AUTO_RANDOM(5, 54) */ COMMENT ‘Primary key id’,
promote_platform_typeint(5) NOT NULL COMMENT ‘Third-party promotion platform type: 1 Douyin, 2 Youzan, 3 Kuaishou, 6 Video Account’,
relate_institution_idvarchar(100) NOT NULL COMMENT ‘Third-party institution ID.’,
relate_institution_namevarchar(100) DEFAULT NULL COMMENT ‘Third-party institution name.’,
role_typevarchar(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_typevarchar(50) DEFAULT NULL COMMENT ‘Module type: main is the main domain (most modules), finance is the financial domain (financial module).’,
task_typeint(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_flagint(5) NOT NULL COMMENT ‘Task mode: 1 normal, 2 key, 3 real-time’,
task_paramtext NOT NULL COMMENT ‘Task parameters: influencer public pool is Douyin ID, general task is URL + header + post parameters’,
task_statusint(5) NOT NULL DEFAULT ‘0’ COMMENT ‘Task status: 0 not executed, 1 executing, 2 completed, 3 abandoned (timeout)’,
get_task_timedatetime DEFAULT NULL COMMENT ‘Task acquisition time’,
finish_task_timedatetime DEFAULT NULL COMMENT ‘Task completion time’,
task_resultlongtext DEFAULT NULL COMMENT ‘Task content’,
create_timedatetime 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


