3282
MariaDBERRORNotableGIS / GeometryHIGH confidence

SRS is not Cartesian (alternate context)

Production Risk

Medium — DDL fails; spatial index cannot be created.

How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE t1 ADD SPATIAL INDEX (geom_col) WHERE ST_SRID(geom_col) = 4326;

expected output

ERROR 3282 (HY000): Function requires a Cartesian spatial reference system.

Fix

Use SRID 0 for spatial indexes

Use SRID 0 for spatial indexes
ALTER TABLE t1 MODIFY COLUMN geom_col GEOMETRY SRID 0 NOT NULL; ALTER TABLE t1 ADD SPATIAL INDEX (geom_col);

Why this works

Spatial indexes in MySQL 8.0 work with both Cartesian and geographic SRS.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3282 ER_SRS_NOT_CARTESIAN2

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

← All MariaDB errors