summaryrefslogtreecommitdiff
path: root/mysql-test/r/join.result
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-05-04 16:43:29 +0300
committergkodinov/kgeorge@magare.gmz <>2007-05-04 16:43:29 +0300
commitd11e1f248bbf6fef285ba068e640b07139b23753 (patch)
tree4a26b2406ab727a76d6d54f20b707e3e6a556225 /mysql-test/r/join.result
parent7f9411c156610819d470cb2786ef69850b4369fb (diff)
downloadmariadb-git-d11e1f248bbf6fef285ba068e640b07139b23753.tar.gz
Bug #27531: the 4.1 fix.
When checking for applicability of join cache we must disable its usage only if there is no temp table in use. When a temp table is used we can use join cache (and it will not make the result-set unordered) to fill the temp table. The filesort() operation is then applied to the data in the temp table and hence is not affected by join cache usage. Fixed by narrowing the condition for disabling join cache to exclude the case where temp table is used.
Diffstat (limited to 'mysql-test/r/join.result')
-rw-r--r--mysql-test/r/join.result50
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index dc763472b0e..9ac8825fcb8 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -376,3 +376,53 @@ i i i
2 NULL 4
2 2 2
drop table t1,t2,t3;
+CREATE TABLE t1 (a int, b int default 0, c int default 1);
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
+INSERT INTO t1 (a) SELECT a + 8 FROM t1;
+INSERT INTO t1 (a) SELECT a + 16 FROM t1;
+CREATE TABLE t2 (a int, d int, e int default 0);
+INSERT INTO t2 (a, d) VALUES (1,1),(2,2),(3,3),(4,4);
+INSERT INTO t2 (a, d) SELECT a+4, a+4 FROM t2;
+INSERT INTO t2 (a, d) SELECT a+8, a+8 FROM t2;
+EXPLAIN
+SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
+ORDER BY t1.b, t1.c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where
+SELECT STRAIGHT_JOIN t2.e FROM t1,t2 WHERE t2.d=1 AND t1.b=t2.e
+ORDER BY t1.b, t1.c;
+e
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+DROP TABLE t1,t2;