summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-07-07 17:37:06 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-01 23:13:01 +0530
commit275ce39f05c364ca25bb7ecaa6a0bb02df83bdc4 (patch)
tree7104e513b33792c46a5a822dbfa8cdeea1c78d89 /sql/item_windowfunc.cc
parent01d2b6e9d94b26ae0df8e900958f91f0c23f203e (diff)
downloadmariadb-git-275ce39f05c364ca25bb7ecaa6a0bb02df83bdc4.tar.gz
Percentile class implemented, most of the functions have the same functionalite as the percentile cont class
Diffstat (limited to 'sql/item_windowfunc.cc')
-rw-r--r--sql/item_windowfunc.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index 8a35cd34e82..051dc203ab9 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -117,6 +117,12 @@ Item_window_func::fix_fields(THD *thd, Item **ref)
my_error(ER_NO_ORDER_LIST_IN_WINDOW_SPEC, MYF(0), window_func()->func_name());
return true;
}
+ /*switch(window_spec->order_list->firt->item[0]->type())
+ {
+ case INT_TYPE:
+ default:
+ break;
+ }*/
}
/*
@@ -215,6 +221,21 @@ void Item_sum_percentile_disc::setup_window_func(THD *thd, Window_spec *window_s
value->store(order_item);
}
+void Item_sum_percentile_cont::setup_window_func(THD *thd, Window_spec *window_spec)
+{
+ order_item= window_spec->order_list->first->item[0];
+ //set_handler_by_cmp_type(order_item->result_type());
+ if (!(ceil_value= order_item->get_cache(thd)))
+ return;
+ ceil_value->setup(thd, order_item);
+ ceil_value->store(order_item);
+
+ if (!(floor_value= order_item->get_cache(thd)))
+ return;
+ floor_value->setup(thd, order_item);
+ floor_value->store(order_item);
+}
+
bool Item_sum_dense_rank::add()
{
if (peer_tracker->check_if_next_group() || first_add)