summaryrefslogtreecommitdiff
path: root/mysql-test/t/gis-rtree.test
diff options
context:
space:
mode:
authorgkodinov/kgeorge@macbook.gmz <>2006-12-19 15:04:26 +0200
committergkodinov/kgeorge@macbook.gmz <>2006-12-19 15:04:26 +0200
commit8e0367918c906047087b49a2273d512dba9c1eac (patch)
treeb63d9f2542044de370a33e6348a8ff0a67e7ec03 /mysql-test/t/gis-rtree.test
parent026196c4ef3217491d22959bafde1cea40f9667b (diff)
downloadmariadb-git-8e0367918c906047087b49a2273d512dba9c1eac.tar.gz
Bug #23578: Corruption prevents Optimize table from working properly with a
spatial index While executing OPTIMIZE TABLE on MyISAM tables the server re-creates the index file(s) in order to sort them physically by the key. This cannot be done for R-tree indexes as it makes no sense. The server was not checking the type of the index and was accessing an R-tree index as if it was a B-tree. Fixed by preventing sorting the index file if it contains an R-tree index.
Diffstat (limited to 'mysql-test/t/gis-rtree.test')
-rw-r--r--mysql-test/t/gis-rtree.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index e34dd14dbfc..1704fe7dc80 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -254,3 +254,20 @@ INSERT INTO t1() VALUES ();
--error 1416
INSERT INTO t1(foo) VALUES ('');
DROP TABLE t1;
+
+#
+# Bug #23578: Corruption prevents Optimize table from working properly with a
+# spatial index
+#
+
+CREATE TABLE t1 (a INT AUTO_INCREMENT, b POINT NOT NULL, KEY (a), SPATIAL KEY (b));
+
+INSERT INTO t1 (b) VALUES (GeomFromText('POINT(1 2)'));
+INSERT INTO t1 (b) SELECT b FROM t1;
+INSERT INTO t1 (b) SELECT b FROM t1;
+INSERT INTO t1 (b) SELECT b FROM t1;
+INSERT INTO t1 (b) SELECT b FROM t1;
+INSERT INTO t1 (b) SELECT b FROM t1;
+
+OPTIMIZE TABLE t1;
+DROP TABLE t1;