Table creation failed with error - Index too long: Specified key was too long; max key length is 3072

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 建表失败报-索引超长Specified key was too long; max key length is 3072

| username: 扬仔_tidb

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version] v6.5.5
[Reproduction Path] What operations were performed that caused the issue
[Encountered Issue: Problem Phenomenon and Impact]
Recently, while migrating from v5.3.0 to v6.5.5, I found that the SQL for creating tables in the old cluster fails on the new cluster.
[Attachment: Screenshot/Log/Monitoring]

The table creation statement above fails on both v6.5.5 and v5.3.0. I adjusted the max-index-length to 12280 using tiup cluster edit-config, but it still fails to create. Does anyone have any solutions? It’s strange that there are many such tables in the v5.3.0 cluster that were created successfully.

| username: 扬仔_tidb | Original post link

Resolved;
There is a length limit for index statements in the original cluster, and the length was lost during synchronization on the CloudCanal platform.
Original index:
idx_xxx xxx(255)
During synchronization, it became
idx_xxx xxx; this definitely exceeds the length limit.