mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -58,6 +58,9 @@ Warning 4038 Syntax error in JSON text in argument 1 to function 'st_geomfromgeo
|
||||
SELECT st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'));
|
||||
st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'))
|
||||
POINT(102 0.5)
|
||||
SELECT st_astext(st_geomfromgeojson('{ "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "type": "Feature" }'));
|
||||
st_astext(st_geomfromgeojson('{ "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "type": "Feature" }'))
|
||||
POINT(102 0.5)
|
||||
SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'));
|
||||
st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'))
|
||||
GEOMETRYCOLLECTION(POINT(102 0.5))
|
||||
|
Reference in New Issue
Block a user