3271
MariaDBERRORNotableGIS / GeometryHIGH confidence

Spatial reference system not found

Production Risk

Medium — geometry operations fail for all rows using the undefined SRID.

How to reproduce
trigger — this will error
trigger — this will error
SELECT ST_AsText(ST_GeomFromText('POINT(1 1)', 999999));

expected output

ERROR 3271 (SR001): There's no spatial reference system with SRID 999999.

Fix 1

Use a standard SRID

Use a standard SRID
SELECT ST_AsText(ST_GeomFromText('POINT(1 1)', 4326));

Why this works

SRID 4326 (WGS 84) is a pre-defined geographic SRS.

Fix 2

Create the SRS

Create the SRS
CREATE SPATIAL REFERENCE SYSTEM 999999 NAME 'My CRS' DEFINITION '...';

Why this works

Registers a custom SRS so it can be referenced by that SRID.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 3271 ER_SRS_NOT_FOUND

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

← All MariaDB errors