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

Method print

sql/sql_lex.cc:2162–2192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2160
2161
2162void st_select_lex_unit::print(String *str, enum_query_type query_type)
2163{
2164 bool union_all= !union_distinct;
2165 for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
2166 {
2167 if (sl != first_select())
2168 {
2169 str->append(STRING_WITH_LEN(" union "));
2170 if (union_all)
2171 str->append(STRING_WITH_LEN("all "));
2172 else if (union_distinct == sl)
2173 union_all= TRUE;
2174 }
2175 if (sl->braces)
2176 str->append('(');
2177 sl->print(thd, str, query_type);
2178 if (sl->braces)
2179 str->append(')');
2180 }
2181 if (fake_select_lex == global_parameters)
2182 {
2183 if (fake_select_lex->order_list.elements)
2184 {
2185 str->append(STRING_WITH_LEN(" order by "));
2186 fake_select_lex->print_order(str,
2187 fake_select_lex->order_list.first,
2188 query_type);
2189 }
2190 fake_select_lex->print_limit(thd, str, query_type);
2191 }
2192}
2193
2194
2195void st_select_lex::print_order(String *str,

Callers 2

print_limitMethod · 0.45
print_table_arrayFunction · 0.45

Calls 14

print_joinFunction · 0.85
db_is_default_dbFunction · 0.85
strmovFunction · 0.85
next_selectMethod · 0.80
print_orderMethod · 0.80
print_limitMethod · 0.80
c_ptrMethod · 0.80
append_ulonglongMethod · 0.80
is_autogeneratedMethod · 0.80
print_item_w_nameMethod · 0.80
append_identifierFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected