The ALTER TABLE statement cannot run online when the table contains a spatial (GIS) index.
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS occurs when MySQL rejects an online ALTER TABLE on a table that has a spatial (GIS) index. Remove ALGORITHM=INPLACE, drop and recreate the GIS index, or use a copy-based alteration to resolve the problem.
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS
Error 3060 is raised when you attempt an online or in-place ALTER TABLE on a table that contains a GIS (spatial) index. MySQL versions 5.7.5 and later restrict certain online DDL operations for spatial indexes because the storage engine cannot update the index concurrently with row changes.
The server returns SQLSTATE HY000 with the message "Do not support online operation on table with GIS index" and cancels the ALTER statement. Understanding the limitation helps you choose the correct alteration method and avoid unexpected downtime.
The primary trigger is specifying ALGORITHM=INPLACE or ALGORITHM=ONLINE implicitly or explicitly in an ALTER TABLE statement on a table that already has an SPATIAL KEY. MySQL detects the spatial index and blocks the online path to protect data integrity.
Other contributing factors include using pt-online-schema-change or gh-ost, which internally request online DDL, and running on MySQL 5.7 or early 8.0 releases where spatial online DDL is not yet implemented.
The quickest fix is to let MySQL use the copy algorithm: omit the ALGORITHM clause or set ALGORITHM=COPY. The server will create a temporary table, copy data, and swap tables, avoiding the unsupported online path.
If downtime must be minimal, drop the spatial index, perform the online ALTER, and then add the index back. This creates two short blocking windows instead of a full copy.
Adding a non-indexed column: run ALTER TABLE t ADD COLUMN col INT, ALGORITHM=COPY; or drop the SPATIAL KEY, run an online add column, and recreate the index.
Changing column type referenced by the spatial index: always plan for a full copy or recreate the table because the index must be rebuilt offline.
Check INFORMATION_SCHEMA.STATISTICS for SPATIAL index types before scheduling online DDL. Automate this check in deployment scripts.
Upgrade to the latest MySQL 8.0 where more operations are supported online, though spatial index changes still require copy in many cases.
Error 1846 (ER_ALTER_OPERATION_NOT_SUPPORTED): General unsupported online DDL. Remove INPLACE or use COPY.
Error 1848 (ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME): Rename blocked by foreign keys. Disable keys or copy.
Using ALGORITHM=INPLACE or the default online algorithm on a table that owns a spatial index triggers error 3060.
Any SPATIAL KEY defined on geometry, point, or polygon columns blocks online alteration because the index cannot be updated concurrently.
Migrations executed by pt-online-schema-change or gh-ost silently request online DDL, surfacing the error when spatial indexes exist.
Generic message for any unsupported online operation. Similar resolution: switch to COPY.
Raised when renaming a column referenced by a foreign key in online mode. Drop constraint or use COPY.
Occurs when changing nullability online. Requires COPY algorithm or staged updates.
A GIS index is a spatial index on geometry data types that accelerates location queries using R-Trees.
MySQL 8.0 adds more online DDL support, but many spatial index changes still require the copy algorithm.
No. MySQL will always block unsupported online alterations involving spatial indexes to protect data integrity.
Galaxy flags tables with spatial indexes during schema introspection, warns you before running online DDL, and suggests the correct algorithm, preventing error 3060.