Common SQL Errors

MySQL Error 3033: ER_GIS_DIFFERENT_SRIDS - How to Fix and Prevent

Galaxy Team
August 8, 2025

ER_GIS_DIFFERENT_SRIDS is raised when a MySQL spatial function receives two geometry values that have different SRID identifiers.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 3033 ER_GIS_DIFFERENT_SRIDS?

ER_GIS_DIFFERENT_SRIDS occurs when MySQL spatial routines receive geometries stored in different SRIDs. Align the SRID of every geometry column or literal with ALTER TABLE or cast them with ST_SRID or ST_Transform to eliminate the mismatch and let the query run.

Error Highlights

Typical Error Message

ER_GIS_DIFFERENT_SRIDS

Error Type

Spatial Error

Language

MySQL

Symbol

different srids: %u and %u, which should have been identical. Geometry values passed as arguments to spatial functions must have the same SRID value. ER_GIS_DIFFERENT_SRIDS was added in 5.7.5.

Error Code

3033

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 3033 ER_GIS_DIFFERENT_SRIDS?

MySQL throws ER_GIS_DIFFERENT_SRIDS when a spatial function such as ST_Intersects, ST_Distance, or ST_Within is called with two geometry operands that carry different Spatial Reference System Identifiers (SRID).

Spatial routines require operands to reside in the same coordinate system so that distances, areas, and relations are computed correctly. When SRID values differ, MySQL aborts the statement to prevent incorrect calculations.

Fixing the mismatch is important because silently converting or ignoring SRIDs would compromise spatial accuracy, leading to faulty analytics or geospatial application bugs.

What Causes This Error?

The error surfaces most often when geometry columns were created with different SRIDs or when literals are constructed without explicitly setting SRID using ST_GeomFromText().

Migrations, data imports, and third-party tools can also introduce mixed SRIDs if they default to 0 or EPSG:4326 while the existing table uses another system.

How to Fix ER_GIS_DIFFERENT_SRIDS

First identify the SRID of each geometry with the ST_SRID() function, then align them by updating data, altering column definitions, or casting operands on the fly.

Stable production fixes alter the column SRID so that all future inserts follow the same reference system. Quick ad-hoc fixes cast literals or columns inside the query.

Common Scenarios and Solutions

Queries joining a WGS-84 point column (SRID 4326) with a planar metric column (SRID 3857) fail until you convert one column to match the other.

Imported shapefiles often default to SRID 0. Update those rows to the correct SRID to unblock spatial predicates.

Best Practices to Avoid This Error

Standardize on a single SRID per database or schema, document it, and enforce it with check constraints or BEFORE INSERT triggers.

During ETL, always set SRID when calling ST_GeomFromText or ST_PointFromText. Validate incoming files with ogrinfo or similar tools before loading.

Related Errors and Solutions

ER_GIS_INVALID_DATA (3034) occurs when geometry WKB or WKT is malformed, not just mismatched. Validate geometries with ST_IsValid.

ER_GIS_UNSUPPORTED_ARGUMENT (3026) appears when a spatial function is called with wrong argument types. Cast to the expected geometry subtype to resolve.

Common Causes

Mixed column definitions

Two tables were created with different SRIDs and later joined in a spatial comparison.

Unspecified SRID on import

Bulk loads that omit SRID leave rows at 0, diverging from the target table.

Manual literals in queries

Developers create points with ST_GeomFromText without setting the third SRID argument.

Schema drift over time

Migrations add new geometry columns using a new SRID without updating the legacy columns.

Related Errors

MySQL Error 3026: ER_GIS_UNSUPPORTED_ARGUMENT

Raised when a spatial function receives mismatched argument types. Cast geometries to compatible subtypes.

MySQL Error 3027: ER_GIS_INVALID_DATA

Occurs when geometry binary text or WKB is malformed. Validate inputs with ST_IsValid.

MySQL Error 3034: ER_GIS_INVALID_DATA

Different code number but similar cause - indicates invalid geometry rather than SRID mismatch.

FAQs

Does changing SRID alter coordinate values?

Setting SRID without transformation only tags the geometry. Use ST_Transform to reproject coordinates safely.

Can I disable SRID checks?

No. MySQL enforces matching SRIDs to guarantee spatial correctness. Always align or convert geometries.

Why does SRID 0 cause problems?

SRID 0 means undefined reference system. Mixing defined and undefined SRIDs triggers the error.

How does Galaxy help avoid this error?

Galaxy highlights SRID metadata in autocomplete and warns when spatial joins mix mismatched SRIDs, preventing faulty queries before execution.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo