summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-04-29 20:23:02 +0500
committerunknown <hf@deer.(none)>2005-04-29 20:23:02 +0500
commit1df25ccdac1855e82fc04b2055c193864f8b33b9 (patch)
treea1ccc4cac7fa2e450dd06586cd94df5312459b26 /mysql-test
parentcfd042108a8d4a38422d965b2a1d1fc8f32f7330 (diff)
downloadmariadb-git-1df25ccdac1855e82fc04b2055c193864f8b33b9.tar.gz
Fix for #6553 and #8776 (no errors on bad spatial data)
mysql-test/r/gis-rtree.result: test result fixed mysql-test/r/gis.result: test result fixed mysql-test/t/gis-rtree.test: test case fixed mysql-test/t/gis.test: test case added sql/field.cc: error messages launched now when we try to put bad spatial data in the GEOMETRY field sql/field.h: interface fixed sql/item_geofunc.cc: bad_data sign now instead of NULL now returned from Item_geometry_from_text::val_str sql/share/errmsg.txt: error message added sql/spatial.cc: bad_geometry data instance sql/spatial.h: bad_geometry_data declaration sql/sql_base.cc: messages now created in store_* function
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gis-rtree.result2
-rw-r--r--mysql-test/r/gis.result14
-rw-r--r--mysql-test/t/gis-rtree.test2
-rw-r--r--mysql-test/t/gis.test16
4 files changed, 28 insertions, 6 deletions
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index 0e558e47594..73cde35993e 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -801,5 +801,5 @@ CREATE TABLE t1 (st varchar(100));
INSERT INTO t1 VALUES ("Fake string");
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
-ERROR HY000: Unknown error
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1, t2;
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 3b196a60d68..93216fe2003 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -461,9 +461,9 @@ Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(Multi
create table t1 (a geometry not null);
insert into t1 values (GeomFromText('Point(1 2)'));
insert into t1 values ('Garbage');
-ERROR HY000: Unknown error
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert IGNORE into t1 values ('Garbage');
-ERROR HY000: Unknown error
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
alter table t1 add spatial index(a);
drop table t1;
create table t1(a geometry not null, spatial index(a));
@@ -655,3 +655,13 @@ t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
drop table t1;
+create table t1 (fl geometry);
+insert into t1 values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (pointfromtext('point(1,1)'));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index da59c6ae5e4..522f7a6f637 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -168,6 +168,6 @@ drop table t1;
CREATE TABLE t1 (st varchar(100));
INSERT INTO t1 VALUES ("Fake string");
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
---error 1105
+--error 1416
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
drop table t1, t2;
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 86c34eacbc5..b7071019e9d 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -165,9 +165,9 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl
create table t1 (a geometry not null);
insert into t1 values (GeomFromText('Point(1 2)'));
--- error 1105
+-- error 1416
insert into t1 values ('Garbage');
--- error 1105
+-- error 1416
insert IGNORE into t1 values ('Garbage');
alter table t1 add spatial index(a);
@@ -359,3 +359,15 @@ select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;
drop table t1;
+
+create table t1 (fl geometry);
+--error 1416
+insert into t1 values (1);
+--error 1416
+insert into t1 values (1.11);
+--error 1416
+insert into t1 values ("qwerty");
+--error 1416
+insert into t1 values (pointfromtext('point(1,1)'));
+
+drop table t1;