3126
MariaDBERRORNotableDDLHIGH confidence

ALTER TABLE IGNORE not supported with INPLACE algorithm

Production Risk

High — IGNORE silently deletes data; always take a backup first.

What this means

ALTER TABLE ... IGNORE was requested with ALGORITHM=INPLACE, but the IGNORE clause requires a table copy to silently discard duplicate or constraint-violating rows.

Why it happens
  1. 1Using ALTER TABLE IGNORE with ALGORITHM=INPLACE.
How to reproduce
trigger — this will error
trigger — this will error
ALTER IGNORE TABLE t1 ADD UNIQUE KEY (col), ALGORITHM=INPLACE;

expected output

ERROR 3126 (HY000): ALGORITHM=INPLACE is not supported. Reason: IGNORE requires table copy.

Fix

Use ALGORITHM=COPY with IGNORE

Use ALGORITHM=COPY with IGNORE
ALTER IGNORE TABLE t1 ADD UNIQUE KEY (col), ALGORITHM=COPY;

Why this works

Allows duplicate rows to be silently discarded during the rebuild.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3126 ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE2

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

← All MariaDB errors