MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / mark_as_dependent

Method mark_as_dependent

sql/sql_lex.cc:1927–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1925*/
1926
1927void st_select_lex::mark_as_dependent(st_select_lex *last)
1928{
1929 /*
1930 Mark all selects from resolved to 1 before select where was
1931 found table as depended (of select where was found table)
1932 */
1933 for (SELECT_LEX *s= this;
1934 s && s != last;
1935 s= s->outer_select())
1936 {
1937 if (!(s->uncacheable & UNCACHEABLE_DEPENDENT))
1938 {
1939 // Select is dependent of outer select
1940 s->uncacheable= (s->uncacheable & ~UNCACHEABLE_UNITED) |
1941 UNCACHEABLE_DEPENDENT;
1942 SELECT_LEX_UNIT *munit= s->master_unit();
1943 munit->uncacheable= (munit->uncacheable & ~UNCACHEABLE_UNITED) |
1944 UNCACHEABLE_DEPENDENT;
1945 for (SELECT_LEX *sl= munit->first_select(); sl ; sl= sl->next_select())
1946 {
1947 if (sl != s &&
1948 !(sl->uncacheable & (UNCACHEABLE_DEPENDENT | UNCACHEABLE_UNITED)))
1949 sl->uncacheable|= UNCACHEABLE_UNITED;
1950 }
1951 }
1952 }
1953}
1954
1955bool st_select_lex_node::set_braces(bool value) { return 1; }
1956bool st_select_lex_node::inc_in_sum_expr() { return 1; }

Callers 1

register_sum_funcMethod · 0.80

Calls 4

outer_selectMethod · 0.80
master_unitMethod · 0.80
first_selectMethod · 0.80
next_selectMethod · 0.80

Tested by

no test coverage detected