1785
MySQLERRORNotableDDLHIGH confidence

INPLACE ALTER not supported with IGNORE

Production Risk

Low — DDL rejected.

What this means

ALTER IGNORE TABLE is not supported with ALGORITHM=INPLACE; the IGNORE keyword requires COPY algorithm to handle duplicate row removal during the rebuild.

Why it happens
  1. 1ALTER IGNORE TABLE used with ALGORITHM=INPLACE explicitly or implicitly.
How to reproduce
trigger — this will error
trigger — this will error
ALTER IGNORE TABLE tbl ALGORITHM=INPLACE, ADD UNIQUE INDEX idx (col);

expected output

ERROR 1785 (0A000): ALGORITHM=INPLACE is not supported. Reason: IGNORE clause not supported.

Fix

Use ALTER IGNORE TABLE with ALGORITHM=COPY

Use ALTER IGNORE TABLE with ALGORITHM=COPY
ALTER IGNORE TABLE tbl ALGORITHM=COPY, ADD UNIQUE INDEX idx (col);

Why this works

COPY algorithm processes the IGNORE clause correctly, discarding duplicate rows.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1785 ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE

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

← All MySQL errors