1780
MariaDBERRORNotableDDLHIGH confidence

ALTER TABLE requires COPY algorithm

Production Risk

Medium — DDL blocked; requires table lock during COPY.

What this means

The ALTER TABLE operation explicitly requires ALGORITHM=COPY and cannot be performed using INPLACE or INSTANT.

Why it happens
  1. 1Changing column data type in a way that requires a full table rebuild.
  2. 2Re-ordering columns which requires COPY.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE tbl ALGORITHM=INPLACE, MODIFY COLUMN val BIGINT; -- some type changes need COPY

expected output

ERROR 1780 (0A000): ALGORITHM=INPLACE is not supported for this operation. Reason: Requires COPY.

Fix

Execute the ALTER with ALGORITHM=COPY

Execute the ALTER with ALGORITHM=COPY
ALTER TABLE tbl ALGORITHM=COPY, LOCK=SHARED, MODIFY COLUMN val BIGINT;

Why this works

Forces a full table rebuild which accommodates any column change.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1780 ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors