Does ALTER TABLE not support merging?

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

Original topic: alter table 不支持合并吗?

| username: Johnpan

When using alter table to add or delete indexes, an error occurs when an alter contains multiple drops or adds, and it can only be split into multiple alters.
Version: tidb5.4.0

alter table vfs_directory drop index idx_root_id, drop index idx_parent_id, algorithm=instant

8200 - Unsupported multi schema change

To improve efficiency, please provide the following information. Clear problem descriptions can be resolved faster:
【TiDB Usage Environment】

【Overview】 Scenario + Problem Overview

【Background】 What operations have been done

【Phenomenon】 Business and database phenomena

【Problem】 The current problem encountered

【Business Impact】

【TiDB Version】

【Application Software and Version】

【Attachments】 Relevant logs and configuration information

  • TiUP Cluster Display Information
  • TiUP Cluster Edit config Information

Monitoring (

  • TiDB-Overview Grafana Monitoring
  • TiDB Grafana Monitoring
  • TiKV Grafana Monitoring
  • PD Grafana Monitoring
  • Corresponding module logs (including logs 1 hour before and after the problem)

If the question is related to performance optimization or fault troubleshooting, please download the script and run it. Please select all and copy and paste the terminal output results for upload.

| username: 啦啦啦啦啦 | Original post link

Support starts from version 6.2

| username: forever | Original post link

Currently not supported

MySQL Compatibility

The ALTER TABLE syntax in TiDB has the following limitations:

  • Multiple changes in a single ALTER TABLE statement are not supported.
  • Changes of the Reorg-Data type on primary key columns are not supported.
  • Column type changes on partitioned tables are not supported.
  • Column type changes on generated columns are not supported.
  • Changes of certain data types (e.g., some time types, Bit, Set, Enum, JSON, etc.) are not supported due to compatibility issues between the CAST function in TiDB and MySQL.
  • Spatial data types are not supported.
  • ALTER TABLE t CACHE | NOCACHE is not standard MySQL syntax but a TiDB extension feature. Refer to Cached Tables.
| username: tidb狂热爱好者 | Original post link

This is supported starting from version 5.2.

| username: 啦啦啦啦啦 | Original post link

You can actually test it. It is only supported starting from the 6.2 release that was published yesterday.

| username: HACK | Original post link

Older versions do not support multiple combinations for DDL.

| username: Johnpan | Original post link

Okay, thank you. I just saw it on the official account today. I’ll upgrade it later.

| username: OnTheRoad | Original post link

Support for merging DDLs started from version 6.2.

| username: 张雨齐0720 | Original post link

Compatibility is continuously improving.

| username: alfred | Original post link

Starting from version 6.2, TiDB continues to improve and advance.

| username: tidb狂热爱好者 | Original post link

Starting from version 6.2, it is supported by default. In version 5.4, you need to manually enable the option.

| username: Johnpan | Original post link

Which option parameter is 5.4?

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.