diff options
author | Georgi Kodinov <joro@sun.com> | 2010-03-08 12:39:57 +0200 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2010-03-08 12:39:57 +0200 |
commit | 2ba46ad4fa9a91d4cc91b45da7df7d97024afc51 (patch) | |
tree | 66bd0abe89bd11ac0a0c60d757197d0d8d513605 /mysql-test | |
parent | 62809e2a096d80e927e04e3f151c59c88f561ffe (diff) | |
download | mariadb-git-2ba46ad4fa9a91d4cc91b45da7df7d97024afc51.tar.gz |
Backport of the fix for bug #51357 to 5.0-bugteam.:
Spatial indexes were not checking for out-of-record condition in
the handler next command when the previous command didn't found
rows.
Fixed by making the rtree index to check for end of rows condition
before re-using the key from the previous search.
Fixed another crash if the tree has changed since the last search.
Added a test case for the other error.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/gis-rtree.result | 22 | ||||
-rw-r--r-- | mysql-test/t/gis-rtree.test | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 165db882892..da146c4a074 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -1526,4 +1526,26 @@ SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1 1 DROP TABLE t1; +# +# Bug #51357: crash when using handler commands on spatial indexes +# +CREATE TABLE t1(a GEOMETRY NOT NULL,SPATIAL INDEX a(a)); +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +a +HANDLER t1 READ a NEXT; +a +HANDLER t1 READ a PREV; +a +HANDLER t1 READ a LAST; +a +HANDLER t1 CLOSE; +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +a +INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +HANDLER t1 READ a NEXT; +a +HANDLER t1 CLOSE; +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 b5de1ccf248..38d50aecf8f 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -902,4 +902,26 @@ SELECT 1 FROM t1 WHERE a >= GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 DROP TABLE t1; +--echo # +--echo # Bug #51357: crash when using handler commands on spatial indexes +--echo # + +CREATE TABLE t1(a GEOMETRY NOT NULL,SPATIAL INDEX a(a)); +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +HANDLER t1 READ a NEXT; +HANDLER t1 READ a PREV; +HANDLER t1 READ a LAST; +HANDLER t1 CLOSE; + +# second crash fixed when the tree has changed since the last search. +HANDLER t1 OPEN; +HANDLER t1 READ a FIRST; +INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); +HANDLER t1 READ a NEXT; +HANDLER t1 CLOSE; + +DROP TABLE t1; + + --echo End of 5.0 tests. |