mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
MWL#90: Switch update_depend_map() back to single loop (so that diff is smaller)
This commit is contained in:
parent
924bdf3e1c
commit
73510c289a
1 changed files with 15 additions and 21 deletions
|
@ -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= first_linear_tab(join, WITH_CONST_TABLES); join_tab;
|
||||
join_tab= next_linear_tab(join, join_tab, WITH_BUSH_ROOTS))
|
||||
{
|
||||
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 )
|
||||
{
|
||||
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;
|
||||
}
|
||||
if (depend_map & 1)
|
||||
ref->depend_map|=(*tab)->ref.depend_map;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue