3103
MySQLERRORNotableSchemaHIGH confidence
In-place ALTER not supported for this virtual column operation
Production Risk
Medium — requires a table copy, causing longer lock times.
What this means
The requested ALTER TABLE operation on a virtual generated column cannot be performed using the in-place algorithm.
Why it happens
- 1Using ALGORITHM=INPLACE when altering a virtual generated column in ways that require a table rebuild.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t MODIFY gen_col INT GENERATED ALWAYS AS (a * 2) VIRTUAL, ALGORITHM=INPLACE;
expected output
ERROR 3103 (HY000): ALGORITHM=INPLACE is not supported for this operation on virtual columns. Try ALGORITHM=COPY.
Fix
Use ALGORITHM=COPY for virtual column changes
Use ALGORITHM=COPY for virtual column changes
ALTER TABLE t MODIFY gen_col INT GENERATED ALWAYS AS (a * 2) VIRTUAL, ALGORITHM=COPY;
Why this works
The COPY algorithm rebuilds the table and supports all ALTER operations.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 3103 ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN2
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev