From 8e1162f830c3b7a19e8632ffc7e1a94a84e171c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Jul 2006 12:56:53 +0500 Subject: bug #14807 (GeomFromText() should return MYSQL_TYPE_GEOMETRY) we didn't have code creating GEOMETRY-type fields from Items (expression results) So i added this code mysql-test/r/gis.result: test result fixed mysql-test/t/gis.test: testcase added sql/item_geofunc.cc: Item_geometry_func::tmp_table_field implemented sql/item_geofunc.h: tmp_table_field() and get_geometry_type() declared --- mysql-test/r/gis.result | 9 +++++++-- mysql-test/t/gis.test | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 7a0f689df36..0dd34c16268 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -574,11 +574,11 @@ INSERT INTO t1 VALUES(GeomFromText('POINT(367894677 368542487)')); INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)')); INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)')); drop table t1; -create table t1 select POINT(1,3); +create table t1 select GeomFromWKB(POINT(1,3)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `POINT(1,3)` longblob NOT NULL + `GeomFromWKB(POINT(1,3))` geometry NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` @@ -704,3 +704,8 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is def asbinary(g) 252 8192 0 Y 128 0 63 asbinary(g) drop table t1; +create table t1 select GeomFromText('point(1 1)'); +desc t1; +Field Type Null Key Default Extra +GeomFromText('point(1 1)') geometry NO +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 4c6ff9b2fe7..7bba34be3ff 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -281,7 +281,7 @@ INSERT INTO t1 VALUES(GeomFromText('POINT(580848489 219587743)')); INSERT INTO t1 VALUES(GeomFromText('POINT(11247614 782797569)')); drop table t1; -create table t1 select POINT(1,3); +create table t1 select GeomFromWKB(POINT(1,3)); show create table t1; drop table t1; @@ -416,3 +416,9 @@ select * from t1; select asbinary(g) from t1; --disable_metadata drop table t1; + + +create table t1 select GeomFromText('point(1 1)'); +desc t1; +drop table t1; + -- cgit v1.2.1