MariaDB ignores SRID in ST_PointFromWKB() function. Is this a bug or am I missing something?

54 views Asked by At

I am running MariaDB 10.11.4 on Debian 12.

I am storing latitude/longitude points using the POINT datatype in an Aria table.

When I attempt to set SRID 4326 for a point, the SRID is left at 0:

UPDATE tablename SET mypoint = ST_PointFromWKB(POINT(lon, lat), 4326) WHERE point_id = 999;
SELECT ST_SRID(mypoint) FROM tablename WHERE point_id = 999;
-- Returns 0: should have been changed to 4326

Also, when I select the SRID directly from a newly generated POINT using ST_PointFromWKB(), it is also reported as 0:

SELECT ST_SRID(ST_PointFromWKB(POINT(1.23, 3.21), 4326));
-- Returns 0: this is incorrect

However, if I create the point using ST_PointFromText, it works - the SRID is retained:

SELECT ST_SRID(ST_PointFromText('POINT(1.23 3.21)', 4326));
-- Returns 4326 as expected.

Why does ST_PointFromWKB ignore the SRID, even though the documentation says it supports this parameter?

0

There are 0 answers