Commit 73510c28 authored by Sergey Petrunya's avatar Sergey Petrunya

MWL#90: Switch update_depend_map() back to single loop (so that diff is smaller)

parent 924bdf3e
......@@ -9268,29 +9268,23 @@ only_eq_ref_tables(JOIN *join,ORDER *order,table_map tables)
static void update_depend_map(JOIN *join)
{
List_iterator<JOIN_TAB_RANGE> it(join->join_tab_ranges);
JOIN_TAB_RANGE *jt_range;
while ((jt_range= it++))
{
for (JOIN_TAB *join_tab=jt_range->start; join_tab != jt_range->end;
join_tab++)
{
TABLE_REF *ref= &join_tab->ref;
table_map depend_map=0;
Item **item=ref->items;
uint i;
for (i=0 ; i < ref->key_parts ; i++,item++)
depend_map|=(*item)->used_tables();
ref->depend_map=depend_map & ~OUTER_REF_TABLE_BIT;
depend_map&= ~OUTER_REF_TABLE_BIT;
for (JOIN_TAB **tab=join->map2table;
depend_map ;
tab++,depend_map>>=1 )
{
if (depend_map & 1)
ref->depend_map|=(*tab)->ref.depend_map;
}
for (JOIN_TAB *join_tab= first_linear_tab(join, WITH_CONST_TABLES); join_tab;
join_tab= next_linear_tab(join, join_tab, WITH_BUSH_ROOTS))
{
TABLE_REF *ref= &join_tab->ref;
table_map depend_map=0;
Item **item=ref->items;
uint i;
for (i=0 ; i < ref->key_parts ; i++,item++)
depend_map|=(*item)->used_tables();
ref->depend_map=depend_map & ~OUTER_REF_TABLE_BIT;
depend_map&= ~OUTER_REF_TABLE_BIT;
for (JOIN_TAB **tab=join->map2table;
depend_map ;
tab++,depend_map>>=1 )
{
if (depend_map & 1)
ref->depend_map|=(*tab)->ref.depend_map;
}
}
}
......
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