summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.h
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-09-07 17:37:55 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-01 23:16:59 +0530
commitb5c104d00a264e250cc008c6f2a42e8a2b18f385 (patch)
tree960483cec33c457ab9e1f2265afe6e84a9e38eee /sql/item_windowfunc.h
parent24e219b179142b3708ff4bdf5ae3db96d6fa184a (diff)
downloadmariadb-git-b5c104d00a264e250cc008c6f2a42e8a2b18f385.tar.gz
Changes made according to the review given, mostly fixing coding style errors
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r--sql/item_windowfunc.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index c1a8c594e20..8b3bd5a26e2 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -757,14 +757,14 @@ public:
bool add()
{
- Item *arg = get_arg(0);
+ Item *arg= get_arg(0);
if (arg->is_null())
return false;
if (first_call)
{
prev_value= arg->val_real();
- if (prev_value >1 || prev_value < 0)
+ if (prev_value > 1 || prev_value < 0)
{
my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0));
return true;
@@ -774,7 +774,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));
return true;
@@ -821,7 +821,7 @@ public:
void fix_length_and_dec()
{
- decimals = 10; // TODO-cvicentiu find out how many decimals the standard
+ decimals = 5; // TODO-cvicentiu find out how many decimals the standard
// requires.
}
@@ -829,6 +829,7 @@ public:
{ return get_item_copy<Item_sum_percentile_disc>(thd, mem_root, this); }
void setup_window_func(THD *thd, Window_spec *window_spec);
void setup_hybrid(THD *thd, Item *item);
+ bool fix_fields(THD *thd, Item **ref);
private:
Item_cache *value;
@@ -876,7 +877,7 @@ public:
bool add()
{
- Item *arg = get_arg(0);
+ Item *arg= get_arg(0);
if (arg->is_null())
return false;
@@ -884,7 +885,7 @@ public:
{
first_call= false;
prev_value= arg->val_real();
- if (prev_value >1 || prev_value < 0)
+ if (prev_value > 1 || prev_value < 0)
{
my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0));
return true;
@@ -892,7 +893,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));
return true;
@@ -950,7 +951,7 @@ public:
void fix_length_and_dec()
{
- decimals = 10; // TODO-cvicentiu find out how many decimals the standard
+ decimals = 5; // TODO-cvicentiu find out how many decimals the standard
// requires.
}
@@ -958,6 +959,7 @@ public:
{ return get_item_copy<Item_sum_percentile_cont>(thd, mem_root, this); }
void setup_window_func(THD *thd, Window_spec *window_spec);
void setup_hybrid(THD *thd, Item *item);
+ bool fix_fields(THD *thd, Item **ref);
private:
Item_cache *floor_value;