summaryrefslogtreecommitdiff
path: root/mysql-test/t/gis-rtree.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/gis-rtree.test')
-rw-r--r--mysql-test/t/gis-rtree.test44
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 682f67c61c4..eba53a8a9c5 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -188,4 +188,48 @@ check table t1 extended;
drop table t1;
+#
+# Bug#17877 - Corrupted spatial index
+#
+CREATE TABLE t1 (
+ c1 geometry NOT NULL default '',
+ SPATIAL KEY i1 (c1(32))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 (c1) VALUES (
+ PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
+ -18.6055555000 -66.8158332999,
+ -18.7186111000 -66.8102777000,
+ -18.7211111000 -66.9269443999,
+ -18.6086111000 -66.9327777000))'));
+# This showed a missing key.
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+#
+CREATE TABLE t1 (
+ c1 geometry NOT NULL default '',
+ SPATIAL KEY i1 (c1(32))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 (c1) VALUES (
+ PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
+ -18.6055555000 -66.8158332999,
+ -18.7186111000 -66.8102777000,
+ -18.7211111000 -66.9269443999,
+ -18.6086111000 -66.9327777000))'));
+INSERT INTO t1 (c1) VALUES (
+ PolygonFromText('POLYGON((-65.7402776999 -96.6686111000,
+ -65.7372222000 -96.5516666000,
+ -65.8502777000 -96.5461111000,
+ -65.8527777000 -96.6627777000,
+ -65.7402776999 -96.6686111000))'));
+# This is the same as the first insert to get a non-unique key.
+INSERT INTO t1 (c1) VALUES (
+ PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
+ -18.6055555000 -66.8158332999,
+ -18.7186111000 -66.8102777000,
+ -18.7211111000 -66.9269443999,
+ -18.6086111000 -66.9327777000))'));
+# This showed (and still shows) OK.
+CHECK TABLE t1 EXTENDED;
+DROP TABLE t1;
+
# End of 4.1 tests