From b4b7d941fea8b17bd0db2d30a74df6596101b4ed Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 15 Nov 2011 13:03:00 -0800 Subject: 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. --- sql/sql_select.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/sql_select.cc') 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; } -- cgit v1.2.1