summaryrefslogtreecommitdiff
path: root/mysql-test/r/join.result
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-05-04 16:43:29 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-05-04 16:43:29 +0300
commit353b6f26b1469f4d77d2eedee9653207503377ed (patch)
tree4a26b2406ab727a76d6d54f20b707e3e6a556225 /mysql-test/r/join.result
parent1a0e3a285818f0a71cdc7f387a63f7cc72c72972 (diff)
downloadmariadb-git-353b6f26b1469f4d77d2eedee9653207503377ed.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. mysql-test/r/join.result: Bug #27531: test case mysql-test/t/join.test: Bug #27531: test case sql/sql_select.cc: Bug #27531: Disable join cache only if not using temp table
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;