summaryrefslogtreecommitdiff
path: root/sql/sql_window.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-06-26 03:53:27 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-01 23:13:01 +0530
commit31f1541f1e367f6eb91f948c4e814bb6554e6b78 (patch)
treed0b53656c6403e36e3f7e0e74e8e3a4cca9dc0ee /sql/sql_window.cc
parentcc046fa92c8724801c3bd725b62a21b849e738f6 (diff)
downloadmariadb-git-31f1541f1e367f6eb91f948c4e814bb6554e6b78.tar.gz
Setting handler to have the return type as that of the element by which we are ordering the partition
Diffstat (limited to 'sql/sql_window.cc')
-rw-r--r--sql/sql_window.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index a4c558b52b6..dc8c66120ff 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -319,6 +319,10 @@ setup_windows(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
while ((win_func_item= li++))
{
win_func_item->update_used_tables();
+ if (win_func_item->only_single_element_order_list())
+ {
+ ((Item_sum_percentile_disc*)win_func_item)->set_type_handler(win_func_item->window_spec);
+ }
}
DBUG_RETURN(0);