summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-12-10 11:28:38 +0200
committerGeorgi Kodinov <joro@sun.com>2009-12-10 11:28:38 +0200
commit30e51fe8540026f00c2c599098257c1e33c9b94f (patch)
treef38546a01badb3a2a1241fb2a1992ae1258932f7 /mysql-test
parentbd308d1256fa7af7128c24f4a5e2abfb8274437a (diff)
downloadmariadb-git-30e51fe8540026f00c2c599098257c1e33c9b94f.tar.gz
Bug #49250 : spatial btree index corruption and crash
SPATIAL and FULLTEXT indexes don't support algorithm selection. Disabled by creating a special grammar rule for these in the parser. Added some encasulation of duplicate parser code.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/fulltext.result14
-rw-r--r--mysql-test/r/gis.result13
-rw-r--r--mysql-test/t/fulltext.test17
-rw-r--r--mysql-test/t/gis.test15
4 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index b0197e0aec2..c27915811d6 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -518,3 +518,17 @@ EXECUTE s;
MATCH (col) AGAINST('findme')
DEALLOCATE PREPARE s;
DROP TABLE t1;
+#
+# Bug #49250 : spatial btree index corruption and crash
+# Part two : fulltext syntax check
+#
+CREATE TABLE t1(col1 TEXT,
+FULLTEXT INDEX USING BTREE (col1));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1))' at line 2
+CREATE TABLE t2(col1 TEXT);
+CREATE FULLTEXT INDEX USING BTREE ON t2(col);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ON t2(col)' at line 1
+ALTER TABLE t2 ADD FULLTEXT INDEX USING BTREE (col1);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1)' at line 1
+DROP TABLE t2;
+End of 5.0 tests
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 140c133d75f..158fdb69c10 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -983,4 +983,17 @@ GEOMFROMTEXT(
SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
1
DROP TABLE t1;
+#
+# Bug #49250 : spatial btree index corruption and crash
+# Part one : spatial syntax check
+#
+CREATE TABLE t1(col1 MULTIPOLYGON NOT NULL,
+SPATIAL INDEX USING BTREE (col1));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1))' at line 2
+CREATE TABLE t2(col1 MULTIPOLYGON NOT NULL);
+CREATE SPATIAL INDEX USING BTREE ON t2(col);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ON t2(col)' at line 1
+ALTER TABLE t2 ADD SPATIAL INDEX USING BTREE (col1);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1)' at line 1
+DROP TABLE t2;
End of 5.0 tests
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 9551c98f143..bcd27e51f24 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -455,3 +455,20 @@ EXECUTE s;
DEALLOCATE PREPARE s;
DROP TABLE t1;
+--echo #
+--echo # Bug #49250 : spatial btree index corruption and crash
+--echo # Part two : fulltext syntax check
+--echo #
+
+--error ER_PARSE_ERROR
+CREATE TABLE t1(col1 TEXT,
+ FULLTEXT INDEX USING BTREE (col1));
+CREATE TABLE t2(col1 TEXT);
+--error ER_PARSE_ERROR
+CREATE FULLTEXT INDEX USING BTREE ON t2(col);
+--error ER_PARSE_ERROR
+ALTER TABLE t2 ADD FULLTEXT INDEX USING BTREE (col1);
+
+DROP TABLE t2;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 701a6cef6be..d2bfe7d90d4 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -669,5 +669,20 @@ SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
DROP TABLE t1;
+--echo #
+--echo # Bug #49250 : spatial btree index corruption and crash
+--echo # Part one : spatial syntax check
+--echo #
+
+--error ER_PARSE_ERROR
+CREATE TABLE t1(col1 MULTIPOLYGON NOT NULL,
+ SPATIAL INDEX USING BTREE (col1));
+CREATE TABLE t2(col1 MULTIPOLYGON NOT NULL);
+--error ER_PARSE_ERROR
+CREATE SPATIAL INDEX USING BTREE ON t2(col);
+--error ER_PARSE_ERROR
+ALTER TABLE t2 ADD SPATIAL INDEX USING BTREE (col1);
+
+DROP TABLE t2;
--echo End of 5.0 tests