summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-07-06 01:29:49 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-01 23:13:01 +0530
commit01d2b6e9d94b26ae0df8e900958f91f0c23f203e (patch)
tree4c3e0c16abfce65d1da5372d8dbd689538facad0 /sql/item_windowfunc.cc
parentd2214da4d0d5d8509dfe928733b5bb866ba59195 (diff)
downloadmariadb-git-01d2b6e9d94b26ae0df8e900958f91f0c23f203e.tar.gz
Implemented the implementation of percentile functions using Item_cache instead of Cache_Item
Diffstat (limited to 'sql/item_windowfunc.cc')
-rw-r--r--sql/item_windowfunc.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index 5e77132ad38..8a35cd34e82 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -111,7 +111,7 @@ Item_window_func::fix_fields(THD *thd, Item **ref)
if (only_single_element_order_list())
{
- // need to change the error, the error should say that we have more than one element in the order list
+ //TODO (varun): need to change the error, the error should say that we have more than one element in the order list
if (window_spec->order_list->elements != 1)
{
my_error(ER_NO_ORDER_LIST_IN_WINDOW_SPEC, MYF(0), window_func()->func_name());
@@ -207,12 +207,12 @@ void Item_sum_dense_rank::setup_window_func(THD *thd, Window_spec *window_spec)
void Item_sum_percentile_disc::setup_window_func(THD *thd, Window_spec *window_spec)
{
- setup_percentile_func(thd, window_spec->order_list);
-}
-
-void Item_sum_percentile_disc::set_type_handler(Window_spec *window_spec)
-{
- type_handler()->get_handler_by_cmp_type(window_spec->order_list->first->item[0]->result_type());
+ order_item= window_spec->order_list->first->item[0];
+ set_handler_by_cmp_type(order_item->result_type());
+ if (!(value= order_item->get_cache(thd)))
+ return;
+ value->setup(thd, order_item);
+ value->store(order_item);
}
bool Item_sum_dense_rank::add()