From 8f3631d0096ceecc21f2879a9558fd9242f09f8c Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sat, 3 Dec 2022 15:09:48 +1100 Subject: MDEV-30150 ST_GeomFromGeoJSON, 'geometry' before 'type: feature' error The geometry type requires Type:"Feature" but the feature need not be first in the JSON structure. Adjust code to return an error if geometry isn't a JSON object, but continue parsing searching for Type: "Feature" to trigger the geometry parsing. Thanks Derick Magnusen for the bug report. --- mysql-test/main/gis-json.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/main/gis-json.test') diff --git a/mysql-test/main/gis-json.test b/mysql-test/main/gis-json.test index 0e1b24a91b6..cda395acab5 100644 --- a/mysql-test/main/gis-json.test +++ b/mysql-test/main/gis-json.test @@ -26,6 +26,7 @@ SELECT st_astext(st_geomfromgeojson('{"type""point"}')); #enable after fix MDEV-27871 --disable_view_protocol SELECT st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }')); +SELECT st_astext(st_geomfromgeojson('{ "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "type": "Feature" }')); SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}')); -- cgit v1.2.1