1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-11881 Empty coordinates must be rejected in GeoJSON objects.

Check for the empty 'coordinates' array.
This commit is contained in:
Alexey Botchkov
2017-11-14 13:36:50 +04:00
parent 5632652804
commit 24184938ad
6 changed files with 60 additions and 1 deletions

View File

@ -89,6 +89,21 @@ ST_AsGeoJSON(ST_GeomFromText("POINT(10 11)"), 100, 1)
SELECT ST_AsGeoJSON(ST_GeomFromText("POINT(10 11)"), 100, 5);
ST_AsGeoJSON(ST_GeomFromText("POINT(10 11)"), 100, 5)
{"bbox": [10, 11, 10, 11], "type": "Point", "coordinates": [10, 11]}
SELECT st_astext(st_geomfromgeojson('{"type": "MultiLineString","coordinates": []}')) as a;
a
NULL
Warnings:
Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array.
SELECT st_astext(st_geomfromgeojson('{"type": "Polygon","coordinates": []}')) as a;
a
NULL
Warnings:
Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array.
SELECT st_astext(st_geomfromgeojson('{"type": "MultiPolygon","coordinates": []}')) as a;
a
NULL
Warnings:
Warning 4076 Incorrect GeoJSON format - empty 'coordinates' array.
#
# End of 10.2 tests
#