summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-11-15 13:03:00 -0800
committerIgor Babaev <igor@askmonty.org>2011-11-15 13:03:00 -0800
commitb4b7d941fea8b17bd0db2d30a74df6596101b4ed (patch)
treeabccede71e3bb1a0c65d0e18f4462ac40bcb1097 /sql/sql_select.cc
parentdb0aed93482759844af7b39c9bf6e7fe141f28f6 (diff)
downloadmariadb-git-b4b7d941fea8b17bd0db2d30a74df6596101b4ed.tar.gz
Fixed LP bug #889750.
If the optimizer switch 'semijoin_with_cache' is set to 'off' then join cache cannot be used to join inner tables of a semijoin. Also fixed a bug in the function check_join_cache_usage() that led to wrong output of the EXPLAIN commands for some test cases.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8d83b4589d5..c25d96ddef1 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -9025,7 +9025,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
if (tab->inside_loosescan_range)
goto no_join_cache;
- if (tab->is_inner_table_of_semi_join_with_first_match() &&
+ if (tab->is_inner_table_of_semijoin() &&
!join->allowed_semijoin_with_cache)
goto no_join_cache;
if (tab->is_inner_table_of_outer_join() &&
@@ -9172,7 +9172,10 @@ uint check_join_cache_usage(JOIN_TAB *tab,
no_join_cache:
if (tab->type != JT_ALL && tab->is_ref_for_hash_join())
+ {
tab->type= JT_ALL;
+ tab->ref.key_parts= 0;
+ }
revise_cache_usage(tab);
return 0;
}