1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-02 14:22:51 +03:00

Window functions: handle window functions as arguments to other functions

Window functions need to have their own column in the work (temp) table,
like aggregate functions do.
They don't need val_int() -> val_int_result() conversion though, so they
should be wrapped with Item_direct_ref, not Item_aggregate_ref.
This commit is contained in:
Sergei Petrunia
2016-04-10 10:13:55 +02:00
parent 91fc90c372
commit 29705a4d38
4 changed files with 63 additions and 8 deletions

View File

@ -7911,7 +7911,7 @@ bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array,
Item_window_func::split_sum_func.
*/
if ((item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM &&
sum_func_list) || item->type() == Item::WINDOW_FUNC_ITEM)
sum_func_list) || item->with_window_func)
item->split_sum_func(thd, ref_pointer_array, *sum_func_list,
SPLIT_SUM_SELECT);
thd->lex->current_select->select_list_tables|= item->used_tables();