summaryrefslogtreecommitdiff
path: root/mysql-test/r/join_cache.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2014-06-10 10:34:58 -0700
committerIgor Babaev <igor@askmonty.org>2014-06-10 10:34:58 -0700
commitd42e6d3a9966803336a3edbb356d344647b31b98 (patch)
tree74728dba9f9d41d5f02e9ada395dff534d962777 /mysql-test/r/join_cache.result
parent216fbe2af3c8dc81f492af79dee61d6a3d333678 (diff)
downloadmariadb-git-d42e6d3a9966803336a3edbb356d344647b31b98.tar.gz
Fixed bug mdev-6071.
The method JOIN_CACHE::init may fail (return 1) if some conditions on the used join buffer is not satisfied. For example it fails if join_buffer_size is greater than join_buffer_space_limit. The conditions should be checked when running the EXPLAIN command for the query. That's why the method JOIN_CACHE::init has to be called for EXPLAIN commands as well.
Diffstat (limited to 'mysql-test/r/join_cache.result')
-rw-r--r--mysql-test/r/join_cache.result27
1 files changed, 25 insertions, 2 deletions
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result
index 7ca28c28b1e..53812bfa227 100644
--- a/mysql-test/r/join_cache.result
+++ b/mysql-test/r/join_cache.result
@@ -5577,8 +5577,8 @@ EXPLAIN
SELECT * FROM t1, t2 LEFT JOIN t3 ON t2.b=t3.b WHERE t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t1, t2 LEFT JOIN t3 ON t2.b=t3.b WHERE t1.a=t2.a;
a a b b c
3 3 30 30 300
@@ -5703,4 +5703,27 @@ select @counter;
2
drop table t1,t2,t3;
set expensive_subquery_limit=default;
+#
+# mdev-6071: EXPLAIN chooses to use join buffer while execution turns it down
+#
+create table t1 (a int);
+insert into t1 values
+(7), (9), (1), (4), (2), (3), (5), (8), (11), (6), (10);
+explain select count(*) from t1, t1 t2 where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 11
+1 SIMPLE t2 ALL NULL NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join)
+set join_buffer_space_limit=1024*8;
+select @@join_buffer_space_limit;
+@@join_buffer_space_limit
+8192
+select @@join_buffer_size;
+@@join_buffer_size
+131072
+explain select count(*) from t1, t1 t2 where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 11
+1 SIMPLE t2 ALL NULL NULL NULL NULL 11 Using where
+set join_buffer_space_limit=default;
+drop table t1;
set @@optimizer_switch=@save_optimizer_switch;