summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-04-10 10:13:55 +0200
committerSergei Petrunia <psergey@askmonty.org>2016-04-10 10:13:55 +0200
commit29705a4d38a9966fe5cebbde0e0f2bc8ba73338c (patch)
tree026030908bc7a2da5f2a93d814dbaa25af7c10f3 /sql/sql_base.cc
parent91fc90c37294ca8bb7e941d162838961818599c2 (diff)
downloadmariadb-git-29705a4d38a9966fe5cebbde0e0f2bc8ba73338c.tar.gz
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.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 819f89d5ac4..009a642a790 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -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();