diff options
author | unknown <holyfoot/hf@deer.(none)> | 2006-11-01 16:44:00 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@deer.(none)> | 2006-11-01 16:44:00 +0400 |
commit | c5453a83a7ab6f99ce0853003748cf61fdc66ddb (patch) | |
tree | 9a517346d85ccae81449f1f90f0270d16aabde10 | |
parent | d0ab146b7ebfa54aedf831d76181e70a8fa2da84 (diff) | |
parent | b8ab82a6294228c65f1ac2a3b3efa82a5abc1dc8 (diff) | |
download | mariadb-git-c5453a83a7ab6f99ce0853003748cf61fdc66ddb.tar.gz |
Merge mysql.com:/home/hf/work/21790/my50-21790
into mysql.com:/home/hf/work/21790/my51-21790
mysql-test/r/gis-rtree.result:
Auto merged
sql/handler.cc:
Auto merged
-rw-r--r-- | mysql-test/r/gis-rtree.result | 8 | ||||
-rw-r--r-- | mysql-test/t/gis-rtree.test | 12 | ||||
-rw-r--r-- | sql/handler.cc | 4 |
3 files changed, 22 insertions, 2 deletions
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 92fcbfcdc9e..d53adf12c89 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -862,3 +862,11 @@ 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 +DROP TABLE t1; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 163f2806ad2..091811b05b3 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -232,3 +232,15 @@ CHECK TABLE t1 EXTENDED; 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 7848552f3de..18356ec3f91 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2092,8 +2092,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; |