diff options
author | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-11-06 11:16:13 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-11-06 11:16:13 +0400 |
commit | 10dd1a371d7c5b99f965ca0bde409baadc772240 (patch) | |
tree | 88ab2db3f92d6eb6d42d2642475766bf609e99ee | |
parent | 4eeef03c4c6683c5a8e9b30ded1ad8576a83bba1 (diff) | |
parent | b8ab82a6294228c65f1ac2a3b3efa82a5abc1dc8 (diff) | |
download | mariadb-git-10dd1a371d7c5b99f965ca0bde409baadc772240.tar.gz |
Merge abotchkov@production.mysql.com:mysql-5.0-opt
into mysql.com:/home/hf/work/21790/my50-21790
mysql-test/t/gis-rtree.test:
Auto merged
mysql-test/r/gis-rtree.result:
merging
-rw-r--r-- | mysql-test/r/gis-rtree.result | 7 | ||||
-rw-r--r-- | mysql-test/t/gis-rtree.test | 12 | ||||
-rw-r--r-- | sql/handler.cc | 4 |
3 files changed, 21 insertions, 2 deletions
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index e017a31f24b..64b21ca988d 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -862,6 +862,13 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); +INSERT INTO t1(foo) VALUES (NULL); +ERROR 23000: Column 'foo' cannot be null +INSERT INTO t1() VALUES (); +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +INSERT INTO t1(foo) VALUES (''); +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1))); INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0))); diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 09cdcb2435e..e34dd14dbfc 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -242,3 +242,15 @@ INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0))); SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0)); DROP TABLE t1; # End of 4.1 tests + +# +# bug #21790 (UNKNOWN ERROR on NULLs in RTree) +# +CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); +--error 1048 +INSERT INTO t1(foo) VALUES (NULL); +--error 1416 +INSERT INTO t1() VALUES (); +--error 1416 +INSERT INTO t1(foo) VALUES (''); +DROP TABLE t1; diff --git a/sql/handler.cc b/sql/handler.cc index 4accc746664..3516b55feb5 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1788,8 +1788,8 @@ void handler::print_error(int error, myf errflag) break; } case HA_ERR_NULL_IN_SPATIAL: - textno= ER_UNKNOWN_ERROR; - break; + my_error(ER_CANT_CREATE_GEOMETRY_OBJECT, MYF(0)); + DBUG_VOID_RETURN; case HA_ERR_FOUND_DUPP_UNIQUE: textno=ER_DUP_UNIQUE; break; |