| 2160 | |
| 2161 | |
| 2162 | void 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 | |
| 2195 | void st_select_lex::print_order(String *str, |
no test coverage detected