diff options
author | Igor Babaev <igor@askmonty.org> | 2011-09-30 21:53:59 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-09-30 21:53:59 -0700 |
commit | 3f82e2edb81448452f647a846c1445efb918493f (patch) | |
tree | 2b928502092db317a1c2800f78731155b20eea43 /sql/sql_select.cc | |
parent | 715dc5f99ddf852a5ef45bcb68c6c86298f6a7c3 (diff) | |
download | mariadb-git-3f82e2edb81448452f647a846c1445efb918493f.tar.gz |
The previous correction of the cost estimate to access a joined table
in the function best_access_path revealed another bug: currently
table scans on NULL keys used for NOT IN subqueries cannot work
together with employment of join caches for inner tables of these
subqueries. Otherwise the result can be wrong as it could be seen
with the result of the test case constructed for bug #37894
in the file subselect3_jcl6.result.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 41c8a3b0121..11939793158 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -9081,6 +9081,11 @@ uint check_join_cache_usage(JOIN_TAB *tab, case JT_EQ_REF: if (cache_level <=2 || (no_hashed_cache && no_bka_cache)) goto no_join_cache; + for (uint i= 0; i < tab->ref.key_parts; i++) + { + if (tab->ref.cond_guards[i]) + goto no_join_cache; + } if (!tab->is_ref_for_hash_join()) { flags= HA_MRR_NO_NULL_ENDPOINTS | HA_MRR_SINGLE_POINT; |