3131
MySQLERRORNotableDDLHIGH confidence

ALTER TABLE not supported: table has FULLTEXT index

Production Risk

Medium — FULLTEXT tables require careful handling during schema changes.

What this means

The presence of a FULLTEXT index on the table prevents the requested in-place ALTER TABLE operation from proceeding; a table copy is required.

Why it happens
  1. 1The table has one or more FULLTEXT indexes and the requested ALTER cannot proceed in-place due to internal FULLTEXT management structures.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE docs ADD COLUMN summary TEXT, ALGORITHM=INPLACE;

expected output

ERROR 3131 (HY000): ALGORITHM=INPLACE is not supported. Reason: Table has a FULLTEXT index.

Fix 1

Drop the FULLTEXT index, perform the ALTER, then re-add

Drop the FULLTEXT index, perform the ALTER, then re-add
ALTER TABLE docs DROP INDEX ft_idx;
ALTER TABLE docs ADD COLUMN summary TEXT;
ALTER TABLE docs ADD FULLTEXT INDEX ft_idx (content);

Why this works

Decoupling the operations avoids the FULLTEXT in-place restriction.

Fix 2

Use ALGORITHM=COPY

Use ALGORITHM=COPY
ALTER TABLE docs ADD COLUMN summary TEXT, ALGORITHM=COPY;

Why this works

Rebuilds the table including all FULLTEXT structures.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3131 ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS2

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

← All MySQL errors