MySQL raises this error when an ALTER TABLE statement tries to add or drop a virtual column together with other table changes in the same in-place operation.
ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN appears when a MySQL ALTER TABLE combines a virtual column add or drop with other actions. Run the virtual column change in a separate ALTER statement to fix the issue.
ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN
MySQL error 3103 with condition ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN fires when an ALTER TABLE tries to add or drop a virtual (generated) column in the same statement as other modifications such as adding indexes or changing storage options.
The server can only perform the virtual column operation using the INPLACE algorithm if it runs alone. Combining it with other actions forces MySQL to abort and return SQL state HY000.
The root cause is a single ALTER TABLE that mixes ADD or DROP of a VIRTUAL column with a second change. MySQL 5.7.8 and later reject that combination because the metadata lock and storage engine APIs cannot guarantee data consistency.
The error is version-specific: MariaDB does not show the same restriction, and MySQL 8.0 continues the limitation unless ALGORITHM=COPY is declared.
Split the ALTER TABLE into two separate statements so the virtual column modification runs first (or second) on its own. This satisfies the INPLACE requirements and prevents the error.
-- Statement 1: add the virtual column only
ALTER TABLE orders
ADD COLUMN v_total DECIMAL(10,2) AS (quantity * price);
-- Statement 2: perform other changes
ALTER TABLE orders
ADD INDEX idx_status (status);
Alternatively, request a full table copy with ALGORITHM=COPY to bypass the restriction, but expect longer execution time and possible locking.
ALTER TABLE orders
ALGORITHM=COPY,
ADD COLUMN v_total DECIMAL(10,2) AS (quantity * price),
ADD INDEX idx_status (status);
Adding an index together with a generated column often triggers the error.
Execute the virtual column addition first, then add the index.
Dropping a virtual column while renaming another column also fails.
Separate the DROP COLUMN statement.
Migrating schemas with tools like Liquibase may generate combined ALTER statements; configure the tool to split statements or use ALGORITHM=COPY.
Always isolate virtual column operations in their own ALTER TABLE when you want INPLACE speed and minimal locking.
Use explicit ALGORITHM and LOCK clauses in migrations to document intent and avoid surprises.
Test schema changes in a staging database running the same MySQL version to catch incompatibilities early.
Galaxy’s version-controlled SQL editor helps track these migrations clearly.
Error 1846 (ER_ALTER_OPERATION_NOT_SUPPORTED) occurs when an operation cannot run with the chosen ALGORITHM or LOCK. Switch to ALGORITHM=COPY.
Error 1060 (ER_DUP_FIELDNAME) surfaces if the new virtual column duplicates an existing name; rename the column.
Error 3107 (ER_ALTER_OPERATION_NOT_SUPPORTED_RENAME) appears when renaming generated columns; drop and recreate instead of rename.
A single ALTER tries to add a virtual column and an index in one statement.
Dropping a virtual column while altering another column attribute.
Migration scripts auto-combine changes for convenience, conflicting with MySQL rules.
Relying on default INPLACE algorithm without specifying COPY when combining actions.
Occurs when a requested ALTER action is impossible with the selected algorithm or lock option.
Happens when adding a column that duplicates an existing column name.
Appears when attempting to rename a generated column.
Yes, ALGORITHM=COPY copies the entire table and bypasses the INPLACE restriction, but it locks the table and takes longer.
No, only VIRTUAL columns trigger error 3103. STORED columns can be altered with other actions in one statement.
The restriction started in MySQL 5.7.8 and continues in all 8.0 versions.
Galaxy’s editor highlights generated columns in schema introspection and lets you run isolated ALTER statements with version control, preventing accidental mixed operations.