Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.11, 11.4, 11.8, 12.3, 13.1
-
Unexpected results
-
`ST_GEOMFROMGEOJSON` when passed a JSON object that specified its "type" after all of the other GeoJSON objects that define it would previously return NULL rather than the object, thanks to Akshat Nehra of AWS for providing a solution to this
Description
Hi,
In JSON, the order of items should has no influence on the results; however, the following test case shows a counterexample:
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type":"GeometryCollection","geometries":[]}')); -- GEOMETRYCOLLECTION EMPTY |
SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[],"type":"GeometryCollection"}')); -- NULL |
SHOW WARNINGS; -- Warning 4038 Syntax error in JSON text in argument 1 to function 'st_geomfromgeojson' at position 18 |
Attachments
Issue Links
- relates to
-
MDEV-39989 GeoJson accepts invalid data
-
- Confirmed
-
-
MDEV-39813 ST_GeomFromGeoJSON does not control recursion depth
-
- Closed
-