Compute the value of window function for all rows. */
| 3058 | Compute the value of window function for all rows. |
| 3059 | */ |
| 3060 | bool Window_func_runner::exec(THD *thd, TABLE *tbl, SORT_INFO *filesort_result) |
| 3061 | { |
| 3062 | List_iterator_fast<Item_window_func> it(window_functions); |
| 3063 | Item_window_func *win_func; |
| 3064 | while ((win_func= it++)) |
| 3065 | { |
| 3066 | win_func->set_phase_to_computation(); |
| 3067 | // TODO(cvicentiu) Setting the aggregator should probably be done during |
| 3068 | // setup of Window_funcs_sort. |
| 3069 | win_func->window_func()->set_aggregator(thd, |
| 3070 | Aggregator::SIMPLE_AGGREGATOR); |
| 3071 | } |
| 3072 | it.rewind(); |
| 3073 | |
| 3074 | List<Cursor_manager> cursor_managers; |
| 3075 | if (get_window_functions_required_cursors(thd, window_functions, |
| 3076 | &cursor_managers)) |
| 3077 | return true; |
| 3078 | |
| 3079 | /* Go through the sorted array and compute the window function */ |
| 3080 | bool is_error= compute_window_func(thd, |
| 3081 | window_functions, |
| 3082 | cursor_managers, |
| 3083 | tbl, filesort_result); |
| 3084 | while ((win_func= it++)) |
| 3085 | { |
| 3086 | win_func->set_phase_to_retrieval(); |
| 3087 | } |
| 3088 | |
| 3089 | cursor_managers.delete_elements(); |
| 3090 | |
| 3091 | return is_error; |
| 3092 | } |
| 3093 | |
| 3094 | |
| 3095 | bool Window_funcs_sort::exec(JOIN *join, bool keep_filesort_result) |
nothing calls this directly
no test coverage detected