diff options
author | gkodinov/kgeorge@magare.gmz <> | 2007-07-09 17:41:24 +0300 |
---|---|---|
committer | gkodinov/kgeorge@magare.gmz <> | 2007-07-09 17:41:24 +0300 |
commit | 3e9679e1fa36a1d788da106cd2629a0e87f1a630 (patch) | |
tree | daaab6d8af7650a06a5d8f7434c1e9a41f71a69a /mysql-test | |
parent | 248650120cfe80a50d14b3e44144b54153749eea (diff) | |
download | mariadb-git-3e9679e1fa36a1d788da106cd2629a0e87f1a630.tar.gz |
Bug #29070: Error in spatial index
1. Threat MBR for a key as double[] and convert it only
when about to store it on disk.
2. Remove the redundant function get_double().
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/gis-rtree.result | 13 | ||||
-rw-r--r-- | mysql-test/t/gis-rtree.test | 19 |
2 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index e4b52fc0392..8476ea9e838 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -1444,3 +1444,16 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK DROP TABLE t1; +CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b)); +INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); +INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); +SELECT COUNT(*) FROM t1 WHERE +MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); +COUNT(*) +2 +SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE +MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); +COUNT(*) +2 +DROP TABLE t1; +End of 5.0 tests. diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 3368aea9741..74b12caca41 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -827,3 +827,22 @@ INSERT INTO t1 (b) SELECT b FROM t1; OPTIMIZE TABLE t1; DROP TABLE t1; + + +# +# Bug #29070: Error in spatial index +# + +CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b)); +INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); +INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); + +# must return the same number as the next select +SELECT COUNT(*) FROM t1 WHERE + MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); +SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE + MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); + +DROP TABLE t1; + +--echo End of 5.0 tests. |