diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2015-04-28 15:31:49 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2015-04-28 15:31:49 +0500 |
commit | a5fa434d0cec39b0db9f67ae2d6a824e2e53e39d (patch) | |
tree | 101d6c0bfc54a3de5d24e10a03ef1d15190b8104 | |
parent | 4c174fcb4aa0ad7173e0e19fb9c7f26e95903187 (diff) | |
download | mariadb-git-a5fa434d0cec39b0db9f67ae2d6a824e2e53e39d.tar.gz |
MDEV-7779 View definition changes upon creation.
Fixed by using POINT instead of ST_POINT in the item.
Later need to fix that with proper ST_POINT implementation
-rw-r--r-- | mysql-test/r/gis.result | 12 | ||||
-rw-r--r-- | mysql-test/t/gis.test | 11 | ||||
-rw-r--r-- | sql/item_geofunc.h | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 700b5de44f5..c2de65ee999 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP VIEW IF EXISTS v1; CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING); CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON); @@ -489,7 +490,7 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select st_issimple(st_multipoint(st_point(3,6),st_point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(st_point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select st_issimple(st_multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); @@ -1610,4 +1611,11 @@ drop table t1; SELECT st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)); st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)) GEOMETRYCOLLECTION EMPTY -End of 5.5 tests +CREATE VIEW v1 AS SELECT POINT(1,1) AS p; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select point(1,1) AS `p` latin1 latin1_swedish_ci +SELECT ASTEXT(p) FROM v1; +ASTEXT(p) +POINT(1 1) +DROP VIEW v1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index bce1fa2c226..6e41660d598 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -7,6 +7,7 @@ --disable_warnings DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; +DROP VIEW IF EXISTS v1; --enable_warnings CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT); @@ -1470,4 +1471,12 @@ drop table t1; # SELECT st_astext(ST_Buffer(ST_PolygonFromText('POLYGON((3 5, 2 4, 2 5, 3 5))'), -100)); ---echo End of 5.5 tests +# +# MDEV-7779 View definition changes upon creation +# +CREATE VIEW v1 AS SELECT POINT(1,1) AS p; +SHOW CREATE VIEW v1; +SELECT ASTEXT(p) FROM v1; +DROP VIEW v1; + +# --echo End of 5.5 tests diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h index 2d715dc8765..a2a61758617 100644 --- a/sql/item_geofunc.h +++ b/sql/item_geofunc.h @@ -116,7 +116,7 @@ class Item_func_point: public Item_geometry_func public: Item_func_point(Item *a, Item *b): Item_geometry_func(a, b) {} Item_func_point(Item *a, Item *b, Item *srid): Item_geometry_func(a, b, srid) {} - const char *func_name() const { return "st_point"; } + const char *func_name() const { return "point"; } String *val_str(String *); Field::geometry_type get_geometry_type() const; }; |