summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.h
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-07-18 01:55:31 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-01 23:13:02 +0530
commitf8e135c7dfc212d24ca6b00df92f9f3ba2d77970 (patch)
tree74b7d45e7647e2793ae9161ff2ac8e027667a539 /sql/item_windowfunc.h
parentf04426f7271388416b69feeb8252d03f0a29df46 (diff)
downloadmariadb-git-f8e135c7dfc212d24ca6b00df92f9f3ba2d77970.tar.gz
made changes according to the review, mostly removing unused code and fixing code to follow the coding conventions
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r--sql/item_windowfunc.h34
1 files changed, 6 insertions, 28 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 995010d2df2..a2357b24980 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -32,22 +32,13 @@ public:
Group_bound_tracker(THD *thd, SQL_I_List<ORDER> *list)
{
- if (list)
+ for (ORDER *curr = list->first; curr; curr=curr->next)
{
- for (ORDER *curr = list->first; curr; curr=curr->next)
- {
Cached_item *tmp= new_Cached_item(thd, curr->item[0], TRUE);
group_fields.push_back(tmp);
- }
}
}
- Group_bound_tracker(THD *thd, Item *item)
- {
- Cached_item *tmp= new_Cached_item(thd, item, FALSE);
- group_fields.push_back(tmp);
- }
-
void init()
{
first_check= true;
@@ -96,19 +87,6 @@ public:
return 0;
}
- bool compare_with_cache_for_null_values()
- {
- List_iterator<Cached_item> li(group_fields);
- Cached_item *ptr;
- while ((ptr= li++))
- {
- ptr->cmp();
- if (ptr->null_value)
- return true;
- }
- return false;
- }
-
private:
List<Cached_item> group_fields;
/*
@@ -797,7 +775,7 @@ public:
double arg_val= arg->val_real();
- if(prev_value != arg_val)
+ if (prev_value != arg_val)
{
my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0));
has_error= TRUE;
@@ -815,7 +793,7 @@ public:
Item_sum_cume_dist::add();
double val= Item_sum_cume_dist::val_real();
- if(val >= prev_value && !val_calculated)
+ if (val >= prev_value && !val_calculated)
val_calculated= true;
return false;
}
@@ -918,7 +896,7 @@ public:
}
double arg_val= arg->val_real();
- if(prev_value != arg_val)
+ if (prev_value != arg_val)
{
my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0));
has_error= TRUE;
@@ -1116,7 +1094,7 @@ public:
bool only_single_element_order_list() const
{
- switch(window_func()->sum_func()){
+ switch (window_func()->sum_func()){
case Item_sum::PERCENTILE_CONT_FUNC:
case Item_sum::PERCENTILE_DISC_FUNC:
return true;
@@ -1127,7 +1105,7 @@ public:
void setting_handler_for_percentile_functions(Item_result rtype) const
{
- switch(window_func()->sum_func()){
+ switch (window_func()->sum_func()){
case Item_sum::PERCENTILE_DISC_FUNC:
((Item_sum_percentile_disc* ) window_func())->set_handler_by_cmp_type(rtype);
break;