summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-08-06 16:27:37 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-08-06 16:27:37 +0400
commit11948d75862941e2780e550cbc5411895e1cc1c7 (patch)
treeccbadb2308209c3c2ac7081ac67f777df23cff7e /mysql-test
parent6d51817d2cd79edbc15328bef532a5375f184219 (diff)
downloadmariadb-git-11948d75862941e2780e550cbc5411895e1cc1c7.tar.gz
MDEV-12180 ST_GeomFromGeoJSON option argument appears to have no effect.
Implement the 'option' argument for the ST_GeomFromGeoJSON.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gis-json.result13
-rw-r--r--mysql-test/t/gis-json.test10
2 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/gis-json.result b/mysql-test/r/gis-json.result
index 8625a5bfb74..8d7c2d12172 100644
--- a/mysql-test/r/gis-json.result
+++ b/mysql-test/r/gis-json.result
@@ -61,6 +61,19 @@ 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))
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',5));
+ERROR HY000: Incorrect option value: '5' for function ST_GeometryFromJSON
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',1));
+ERROR 22023: Invalid GIS data provided to function ST_GeometryFromJSON.
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2));
+ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2))
+POINT(5.3 15)
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',3));
+ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',3))
+POINT(5.3 15)
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',4));
+ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',4))
+POINT(5.3 15)
#
# End of 10.2 tests
#
diff --git a/mysql-test/t/gis-json.test b/mysql-test/t/gis-json.test
index 645c21bf011..67674c9b33f 100644
--- a/mysql-test/t/gis-json.test
+++ b/mysql-test/t/gis-json.test
@@ -23,6 +23,16 @@ SELECT st_astext(st_geomfromgeojson('{"type""point"}'));
SELECT st_astext(st_geomfromgeojson('{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] } }'));
SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "prop0": "value0" } }]}'));
+--error ER_WRONG_VALUE_FOR_TYPE
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',5));
+
+--error ER_GIS_INVALID_DATA
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',1));
+
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',2));
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',3));
+SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',4));
+
--echo #
--echo # End of 10.2 tests
--echo #