Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 新增主键报错-8200 - Unsupported multi schema change
[TiDB Usage Environment] Production Environment
[TiDB Version] V5.2.4
[Reproduction Path] Adding a primary key to the table reports error 8200 - Unsupported multi schema change
UPDATE Reference_AAD SET Entity = REPLACE(Entity, EntityName, “”) ORDER BY CreateTime DESC;
UPDATE Reference_AAD SET Entity = REPLACE(Entity, “&&”, “”) ORDER BY CreateTime DESC;
Only one column of data can be changed at a time.
Version 5 does not yet support multiple schema changes at once. You can check the change SQL generated by Navicat through SQL preview. Starting from approximately version 6.2, multiple schema changes will be supported.
I just updated a column. The primary key 123 already existed before, and adding the primary key 4 resulted in an error.
Try using the alter command.
Is this it? I see that the SQL execution itself is an alter.
Drop it first, then add it, split into two statements.
Thank you. Performing the operations separately worked. Resetting the primary key on a large table is indeed very slow.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.