summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2006-05-27 23:57:33 -0700
committerigor@rurik.mysql.com <>2006-05-27 23:57:33 -0700
commit377b3e0306b0b5ba8769ad23689f1aa6d92a0fdc (patch)
treeb79720aa64490cd88ed6b40aa30a5fd6ca4d822f /mysql-test/t/select.test
parent6d285f8a29fd6e495fd16153780297717931344f (diff)
downloadmariadb-git-377b3e0306b0b5ba8769ad23689f1aa6d92a0fdc.tar.gz
Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX
refers to a column name. Added a new error message ER_INDEX_DOES_NOT_EXIST.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test19
1 files changed, 17 insertions, 2 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 996d5854854..90d54e59b61 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1295,9 +1295,9 @@ explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
# The next should give an error
#
--- error 1072
+-- error 1303
explain select fld3 from t2 ignore index (fld3,not_used);
--- error 1072
+-- error 1303
explain select fld3 from t2 use index (not_used);
#
@@ -2248,4 +2248,19 @@ insert into t2 values(1,1);
select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2));
drop table t1,t2;
+#
+# Bug #17873: confusing error message when IGNORE INDEX refers a column name
+#
+
+CREATE TABLE t1 (a int, INDEX idx(a));
+INSERT INTO t1 VALUES (2), (3), (1);
+
+EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx);
+--error 1303
+EXPLAIN SELECT * FROM t1 IGNORE INDEX (a);
+--error 1303
+EXPLAIN SELECT * FROM t1 FORCE INDEX (a);
+
+DROP TABLE t1;
+
# End of 4.1 tests