Commit d44f68ae authored by Sergey Petrunya's avatar Sergey Petrunya

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

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