Function to setup clauses without sum functions. */
| 927 | Function to setup clauses without sum functions. |
| 928 | */ |
| 929 | static inline int |
| 930 | setup_without_group(THD *thd, Ref_ptr_array ref_pointer_array, |
| 931 | TABLE_LIST *tables, |
| 932 | List<TABLE_LIST> &leaves, |
| 933 | List<Item> &fields, |
| 934 | List<Item> &all_fields, |
| 935 | COND **conds, |
| 936 | ORDER *order, |
| 937 | ORDER *group, |
| 938 | List<Window_spec> &win_specs, |
| 939 | List<Item_window_func> &win_funcs, |
| 940 | bool *hidden_group_fields) |
| 941 | { |
| 942 | int res; |
| 943 | enum_parsing_place save_place; |
| 944 | st_select_lex *const select= thd->lex->current_select; |
| 945 | nesting_map save_allow_sum_func= thd->lex->allow_sum_func; |
| 946 | /* |
| 947 | Need to stave the value, so we can turn off only any new non_agg_field_used |
| 948 | additions coming from the WHERE |
| 949 | */ |
| 950 | const bool saved_non_agg_field_used= select->non_agg_field_used(); |
| 951 | DBUG_ENTER("setup_without_group"); |
| 952 | |
| 953 | thd->lex->allow_sum_func.clear_bit(select->nest_level); |
| 954 | res= setup_conds(thd, tables, leaves, conds, &all_fields); |
| 955 | |
| 956 | /* it's not wrong to have non-aggregated columns in a WHERE */ |
| 957 | select->set_non_agg_field_used(saved_non_agg_field_used); |
| 958 | |
| 959 | thd->lex->allow_sum_func.set_bit(select->nest_level); |
| 960 | |
| 961 | save_place= thd->lex->current_select->context_analysis_place; |
| 962 | thd->lex->current_select->context_analysis_place= IN_ORDER_BY; |
| 963 | res= res || setup_order(thd, ref_pointer_array, tables, fields, all_fields, |
| 964 | order); |
| 965 | thd->lex->allow_sum_func.clear_bit(select->nest_level); |
| 966 | thd->lex->current_select->context_analysis_place= IN_GROUP_BY; |
| 967 | res= res || setup_group(thd, ref_pointer_array, tables, fields, all_fields, |
| 968 | group, hidden_group_fields); |
| 969 | thd->lex->current_select->context_analysis_place= save_place; |
| 970 | thd->lex->allow_sum_func.set_bit(select->nest_level); |
| 971 | res= res || setup_windows(thd, ref_pointer_array, tables, fields, all_fields, |
| 972 | win_specs, win_funcs); |
| 973 | thd->lex->allow_sum_func= save_allow_sum_func; |
| 974 | DBUG_RETURN(res); |
| 975 | } |
| 976 | |
| 977 | bool vers_select_conds_t::init_from_sysvar(THD *thd) |
| 978 | { |
no test coverage detected