MCPcopy Create free account
hub / github.com/MariaDB/server / update_depend_map_for_order

Function update_depend_map_for_order

sql/sql_select.cc:17577–17599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17575/** Update the dependency map for the sort order. */
17576
17577static void update_depend_map_for_order(JOIN *join, ORDER *order)
17578{
17579 for (; order ; order=order->next)
17580 {
17581 table_map depend_map;
17582 order->item[0]->update_used_tables();
17583 order->depend_map=depend_map=order->item[0]->used_tables();
17584 order->used= 0;
17585 // Not item_sum(), RAND() and no reference to table outside of sub select
17586 if (!(order->depend_map & (OUTER_REF_TABLE_BIT | RAND_TABLE_BIT))
17587 && !order->item[0]->with_sum_func() &&
17588 join->join_tab)
17589 {
17590 for (JOIN_TAB **tab=join->map2table;
17591 depend_map ;
17592 tab++, depend_map>>=1)
17593 {
17594 if (depend_map & 1)
17595 order->depend_map|=(*tab)->ref.depend_map;
17596 }
17597 }
17598 }
17599}
17600
17601
17602/**

Callers 1

remove_constFunction · 0.85

Calls 3

with_sum_funcMethod · 0.80
update_used_tablesMethod · 0.45
used_tablesMethod · 0.45

Tested by

no test coverage detected