Commit 5eda18f0 authored by Anel Husakovic's avatar Anel Husakovic

MDEV-25272: Wrong function name in error messages upon ST_GeomFromGeoJSON call

- Invalid function name during ER_WRONG_VALUE_FOR_TYPE and ER_GIS_INVALID_DATA
parent 6769d1a0
...@@ -62,9 +62,9 @@ SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features": ...@@ -62,9 +62,9 @@ SELECT st_astext(st_geomfromgeojson('{ "type": "FeatureCollection", "features":
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)) GEOMETRYCOLLECTION(POINT(102 0.5))
SELECT ST_AsText(ST_GeomFromGeoJSON('{ "type": "Point", "coordinates": [5.3, 15.0, 4.3]}',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 ERROR HY000: Incorrect option value: '5' for function ST_GeomFromGeoJSON
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]}',1));
ERROR 22023: Invalid GIS data provided to function ST_GeometryFromJSON. ERROR 22023: Invalid GIS data provided to function ST_GeomFromGeoJSON.
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]}',2));
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) POINT(5.3 15)
......
...@@ -145,7 +145,7 @@ String *Item_func_geometry_from_json::val_str(String *str) ...@@ -145,7 +145,7 @@ String *Item_func_geometry_from_json::val_str(String *str)
{ {
String *sv= args[1]->val_str(&tmp_js); String *sv= args[1]->val_str(&tmp_js);
my_error(ER_WRONG_VALUE_FOR_TYPE, MYF(0), my_error(ER_WRONG_VALUE_FOR_TYPE, MYF(0),
"option", sv->c_ptr_safe(), "ST_GeometryFromJSON"); "option", sv->c_ptr_safe(), "ST_GeomFromGeoJSON");
null_value= 1; null_value= 1;
return 0; return 0;
} }
...@@ -182,7 +182,7 @@ String *Item_func_geometry_from_json::val_str(String *str) ...@@ -182,7 +182,7 @@ String *Item_func_geometry_from_json::val_str(String *str)
code= ER_GEOJSON_NOT_CLOSED; code= ER_GEOJSON_NOT_CLOSED;
break; break;
case Geometry::GEOJ_DIMENSION_NOT_SUPPORTED: case Geometry::GEOJ_DIMENSION_NOT_SUPPORTED:
my_error(ER_GIS_INVALID_DATA, MYF(0), "ST_GeometryFromJSON"); my_error(ER_GIS_INVALID_DATA, MYF(0), "ST_GeomFromGeoJSON");
break; break;
default: default:
report_json_error_ex(js, &je, func_name(), 0, Sql_condition::WARN_LEVEL_WARN); report_json_error_ex(js, &je, func_name(), 0, Sql_condition::WARN_LEVEL_WARN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment