Skip to content

Commit 33de044

Browse files
committed
Bug#21651588 VIEW RETURNS ERROR WITH ST_CONVEXHULL() FUNCTION
Issue: The function name of ST_ConvexHull was wrongly written so it could not be found. Fix: Fix the function name. Also fix another function name ST_SRID(), it should be "ST_SRID" because "SRID()" is deprecated now.
1 parent 04faf89 commit 33de044

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

mysql-test/r/gis-precise.result

+3-3
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ POLYGON((0 0,30 0,30 30,0 30,0 0))
747747
select ST_astext(ST_centroid(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0)))))));
748748
ERROR 22023: Invalid GIS data provided to function st_centroid.
749749
select ST_astext(ST_convexhull(ST_PolyFromWKB(ST_AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(1, 0), Point(0, 0)))))));
750-
ERROR 22023: Invalid GIS data provided to function st_convex_hull.
750+
ERROR 22023: Invalid GIS data provided to function st_convexhull.
751751
SELECT ST_AsText(ST_Centroid(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')));
752752
ST_AsText(ST_Centroid(ST_GeomFromText('GEOMETRYCOLLECTION(POINT(10 10),MULTIPOINT(0 0,10 10))')))
753753
POINT(6.666666666666667 6.666666666666667)
@@ -795,9 +795,9 @@ SELECT ST_AsText(ST_Convexhull(ST_GeomFromText('multilinestring((0 0, 1 1, 2 2),
795795
ST_AsText(ST_Convexhull(ST_GeomFromText('multilinestring((0 0, 1 1, 2 2), (3 3, 4 4, 5 5))')))
796796
LINESTRING(0 0,5 5)
797797
SELECT ST_AsText(ST_Convexhull(ST_GeomFromText('polygon((0 0, 1 1, 2 2, 0 0), (3 3, 4 4, 5 5, 3 3))')));
798-
ERROR 22023: Invalid GIS data provided to function st_convex_hull.
798+
ERROR 22023: Invalid GIS data provided to function st_convexhull.
799799
SELECT ST_AsText(ST_Convexhull(ST_GeomFromText('multipolygon(((0 0, 1 1, 2 2, 0 0), (3 3, 4 4, 5 5, 3 3)), ((0 0, 1 0, 1 1, 0 1, 0 0)))')));
800-
ERROR 22023: Invalid GIS data provided to function st_convex_hull.
800+
ERROR 22023: Invalid GIS data provided to function st_convexhull.
801801
SELECT ST_AsText(ST_Convexhull(ST_GeomFromText('geometrycollection(polygon((0 0, 3 0, 3 3, 0 3, 0 0), (1 1, 2 1, 2 2, 1 2, 1 1)), polygon((0 0, 1 0, 1 1, 0 1, 0 0)))')));
802802
ST_AsText(ST_Convexhull(ST_GeomFromText('geometrycollection(polygon((0 0, 3 0, 3 3, 0 3, 0 0), (1 1, 2 1, 2 2, 1 2, 1 1)), polygon((0 0, 1 0, 1 1, 0 1, 0 0)))')))
803803
POLYGON((0 0,3 0,3 3,0 3,0 0))

mysql-test/r/gis.result

+19-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
465465
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
466466
Warnings:
467467
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
468-
Note 1003 /* select#1 */ select srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101))`
468+
Note 1003 /* select#1 */ select st_srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101))`
469469
explain extended select ST_issimple(MultiPoint(Point(3, 6), Point(4, 10))), ST_issimple(Point(3, 6));
470470
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
471471
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -2254,3 +2254,21 @@ ST_GEOMFROMTEXT(
22542254
)
22552255
)
22562256
1
2257+
#
2258+
# Bug#21651588 VIEW RETURNS ERROR WITH ST_CONVEXHULL() FUNCTION
2259+
#
2260+
SELECT ST_ASTEXT(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)'))) as result;
2261+
result
2262+
LINESTRING(0 0,5 5)
2263+
CREATE VIEW v1 AS SELECT
2264+
ST_ASTEXT(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)')));
2265+
CREATE VIEW v2 AS SELECT
2266+
ST_SRID(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)')));
2267+
SELECT * FROM v1;
2268+
Name_exp_1
2269+
LINESTRING(0 0,5 5)
2270+
SELECT * FROM v2;
2271+
ST_SRID(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)')))
2272+
0
2273+
DROP VIEW v1;
2274+
DROP VIEW v2;

mysql-test/suite/innodb_gis/r/1.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
463463
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
464464
Warnings:
465465
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
466-
Note 1003 /* select#1 */ select srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101))`
466+
Note 1003 /* select#1 */ select st_srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101))`
467467
explain extended select ST_issimple(MultiPoint(Point(3, 6), Point(4, 10))), ST_issimple(Point(3, 6));
468468
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
469469
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used

mysql-test/suite/innodb_gis/r/gis.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ id select_type table partitions type possible_keys key key_len ref rows filtered
463463
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used
464464
Warnings:
465465
Warning 1681 'EXTENDED' is deprecated and will be removed in a future release.
466-
Note 1003 /* select#1 */ select srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101))`
466+
Note 1003 /* select#1 */ select st_srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `ST_SRID(ST_GeomFromText('LineString(1 1,2 2)',101))`
467467
explain extended select ST_issimple(MultiPoint(Point(3, 6), Point(4, 10))), ST_issimple(Point(3, 6));
468468
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
469469
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used

mysql-test/t/gis.test

+14
Original file line numberDiff line numberDiff line change
@@ -2281,3 +2281,17 @@ SELECT ST_NUMINTERIORRING(
22812281
'POLYGON((0 0, 1 0, 1 1, 0 0),(0.1 0.1, 0.9 0.8, 0.9 0.1, 0.1 0.1))'
22822282
)
22832283
);
2284+
2285+
2286+
--echo #
2287+
--echo # Bug#21651588 VIEW RETURNS ERROR WITH ST_CONVEXHULL() FUNCTION
2288+
--echo #
2289+
SELECT ST_ASTEXT(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)'))) as result;
2290+
CREATE VIEW v1 AS SELECT
2291+
ST_ASTEXT(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)')));
2292+
CREATE VIEW v2 AS SELECT
2293+
ST_SRID(ST_CONVEXHULL(ST_GEOMFROMTEXT('LINESTRING(0 0, 5 5)')));
2294+
SELECT * FROM v1;
2295+
SELECT * FROM v2;
2296+
DROP VIEW v1;
2297+
DROP VIEW v2;

sql/item_geofunc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ class Item_func_convex_hull: public Item_geometry_func
461461
bool bg_convex_hull(const Geometry *geom, String *wkb);
462462
public:
463463
Item_func_convex_hull(const POS &pos, Item *a): Item_geometry_func(pos, a) {}
464-
const char *func_name() const { return "st_convex_hull"; }
464+
const char *func_name() const { return "st_convexhull"; }
465465
String *val_str(String *);
466466
Field::geometry_type get_geometry_type() const;
467467
};
@@ -1102,7 +1102,7 @@ class Item_func_srid: public Item_int_func
11021102
public:
11031103
Item_func_srid(const POS &pos, Item *a): Item_int_func(pos, a) {}
11041104
longlong val_int();
1105-
const char *func_name() const { return "srid"; }
1105+
const char *func_name() const { return "st_srid"; }
11061106
void fix_length_and_dec() { max_length= 10; maybe_null= 1; }
11071107
};
11081108

0 commit comments

Comments
 (0)