summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-04-10 19:08:08 +0300
committergkodinov/kgeorge@magare.gmz <>2007-04-10 19:08:08 +0300
commit9514ac9f29c54e6006413ce5e5b968f593b73287 (patch)
tree5bc55ece73a4eca9ba2b48ae2cbc57214e60baa0 /mysql-test/t/select.test
parent204559cd2c3961f1bac8865ff56e4a06aa00ba6f (diff)
downloadmariadb-git-9514ac9f29c54e6006413ce5e5b968f593b73287.tar.gz
Bug #19372:
Added a test case. The problem was fixed by the fix for bug #17379. The problem was that because of some conditions the optimizer always preferred range or full index scan access methods to lookup access methods even when the latter were much cheaper.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index c5c7d07ee25..56b2f1b02b8 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3357,4 +3357,17 @@ SELECT t2.faq_id
DROP TABLE t1,t2;
+
+#
+# Bug #19372: Optimizer does not use index anymore when WHERE index NOT IN
+# () is added
+#
+CREATE TABLE t1 (a INT, b INT, KEY inx (b,a));
+
+INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7);
+EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2
+ ON ( f1.b=f2.b AND f1.a<f2.a )
+ WHERE 1 AND f1.b NOT IN (100,2232,3343,51111);
+DROP TABLE t1;
+
--echo End of 5.0 tests