Commit 3f82e2ed authored by Igor Babaev's avatar Igor Babaev

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.
parent 715dc5f9
...@@ -822,8 +822,6 @@ LEFT JOIN t1 AS INNR ON ( INNR2.int_key = INNR.int_key ) ...@@ -822,8 +822,6 @@ LEFT JOIN t1 AS INNR ON ( INNR2.int_key = INNR.int_key )
WHERE INNR.varchar_key > 'n{' WHERE INNR.varchar_key > 'n{'
); );
varchar_nokey varchar_nokey
NULL
p
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (11); INSERT INTO t1 VALUES (1), (2), (11);
......
...@@ -9081,6 +9081,11 @@ uint check_join_cache_usage(JOIN_TAB *tab, ...@@ -9081,6 +9081,11 @@ uint check_join_cache_usage(JOIN_TAB *tab,
case JT_EQ_REF: case JT_EQ_REF:
if (cache_level <=2 || (no_hashed_cache && no_bka_cache)) if (cache_level <=2 || (no_hashed_cache && no_bka_cache))
goto no_join_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()) if (!tab->is_ref_for_hash_join())
{ {
flags= HA_MRR_NO_NULL_ENDPOINTS | HA_MRR_SINGLE_POINT; flags= HA_MRR_NO_NULL_ENDPOINTS | HA_MRR_SINGLE_POINT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment