summaryrefslogtreecommitdiff
path: root/mysql-test/r/join_cache.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-12-25 18:54:14 -0800
committerIgor Babaev <igor@askmonty.org>2010-12-25 18:54:14 -0800
commit1eb21dc4be059b808f79de4702aaa9204ae4a41e (patch)
treeb847fcaad991711e771896abf8dd957db91563b7 /mysql-test/r/join_cache.result
parent1eb5e0e60388f460ab2c4d216a98f4088d9997b9 (diff)
parentd9a81475c70aebc1f2542bf0c115b3ebd9649193 (diff)
downloadmariadb-git-1eb21dc4be059b808f79de4702aaa9204ae4a41e.tar.gz
Merge
Diffstat (limited to 'mysql-test/r/join_cache.result')
-rw-r--r--mysql-test/r/join_cache.result35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result
index d26ad9bf5ce..bbe326d7b19 100644
--- a/mysql-test/r/join_cache.result
+++ b/mysql-test/r/join_cache.result
@@ -6087,4 +6087,39 @@ pk a pk a
50 ee 14 ee
SET SESSION join_cache_level = DEFAULT;
DROP TABLE t1,t2;
+#
+# Bug #694092: incorrect detection of index only pushdown conditions
+#
+CREATE TABLE t1 (
+f1 varchar(10), f3 int(11), PRIMARY KEY (f3)
+);
+INSERT INTO t1 VALUES ('y',1),('or',5);
+CREATE TABLE t2 (
+f3 int(11), f2 varchar(1024), f4 varchar(10), PRIMARY KEY (f3)
+);
+INSERT INTO t2 VALUES (6,'RPOYT','y'),(10,'JINQE','m');
+SET SESSION join_cache_level = 1;
+SET SESSION optimizer_switch = 'index_condition_pushdown=off';
+EXPLAIN
+SELECT * FROM t1,t2
+WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using MRR
+1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using MRR; Using join buffer (flat, BNL join)
+SELECT * FROM t1,t2
+WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6);
+f1 f3 f3 f2 f4
+SET SESSION optimizer_switch = 'index_condition_pushdown=on';
+EXPLAIN
+SELECT * FROM t1,t2
+WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using MRR
+1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Using MRR; Using join buffer (flat, BNL join)
+SELECT * FROM t1,t2
+WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6);
+f1 f3 f3 f2 f4
+SET SESSION join_cache_level = DEFAULT;
+SET SESSION optimizer_switch = DEFAULT;
+DROP TABLE t1,t2;
set @@optimizer_switch=@save_optimizer_switch;