Commit d30c3205 authored by Sergey Petrunya's avatar Sergey Petrunya

Post-merge fixes part 4

parent b63eabc1
......@@ -923,7 +923,7 @@ int JOIN_CACHE::alloc_buffer()
//psergey-merge: for (tab= join->join_tab+join->const_tables; tab <= join_tab; tab++)
// for (tab= cache->join_tab-cache->tables; tab < cache->join_tab ; tab++)
// (fixed)
for (tab= join->join_tab + join->const_tables; tab!= join_tab;
for (tab= /*join->join_tab + join->const_tables*/ start_tab; tab!= join_tab;
tab= next_linear_tab(join, tab, FALSE))
{
cache= tab->cache;
......
......@@ -8429,10 +8429,12 @@ void check_join_cache_usage_for_tables(JOIN *join, ulonglong options,
if (!(tab >= first_sjm_table && tab < last_sjm_table))
tab->first_sjm_sibling= NULL;
#endif
JOIN_TAB *prev_tab;
restart:
tab->icp_other_tables_ok= TRUE;
tab->idx_cond_fact_out= TRUE;
JOIN_TAB *prev_tab= tab - 1;
prev_tab= tab - 1;
if ((tab->bush_root_tab && tab->bush_root_tab->bush_children->start == tab))
prev_tab= NULL;
......@@ -8450,11 +8452,20 @@ void check_join_cache_usage_for_tables(JOIN *join, ulonglong options,
// tab-1);
prev_tab);
tab->use_join_cache= test(tab->used_join_cache_level);
DBUG_ASSERT(!join->return_tab);
/*
psergey-merge: todo: raise the question that this is really stupid that
we can first allocate a join buffer, then decide not to use it and free
it.
*/
/*
if (join->return_tab)
i= join->return_tab-join->join_tab-1; // always >= 0
*/
if (join->return_tab)
{
tab= join->return_tab;
goto restart;
}
break;
default:
tab->used_join_cache_level= 0;
......
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