3122
MySQLERRORNotableDDLHIGH confidence
ALTER TABLE not supported because table is partitioned
Production Risk
Medium — partition rebuild can be time-consuming for large partitioned tables.
What this means
The requested ALTER TABLE algorithm (INPLACE or INSTANT) cannot be used because the table is partitioned and the operation requires a full table copy.
Why it happens
- 1Attempting ALGORITHM=INPLACE on a partitioned InnoDB table where the operation is unsupported.
- 2Partition-related changes incompatible with in-place modification.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE partitioned_t ADD COLUMN y INT, ALGORITHM=INPLACE;
expected output
ERROR 3122 (HY000): ALGORITHM=INPLACE is not supported. Reason: Partition requires table copy.
Fix
Use ALGORITHM=COPY for partitioned tables
Use ALGORITHM=COPY for partitioned tables
ALTER TABLE partitioned_t ADD COLUMN y INT, ALGORITHM=COPY;
Why this works
Rebuilds each partition as needed.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 3122 ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION2
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev