Skip to content

Commit

Permalink
Update the error messages involving percentile functions
Browse files Browse the repository at this point in the history
  • Loading branch information
varunraiko committed Nov 1, 2017
1 parent 0ef6127 commit 4088791
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions sql/item_windowfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ class Item_sum_percentile_disc : public Item_sum_cume_dist,
prev_value= arg->val_real();
if (prev_value > 1 || prev_value < 0)
{
my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0));
my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0), func_name());
return true;
}
first_call= false;
Expand All @@ -776,7 +776,7 @@ class Item_sum_percentile_disc : public Item_sum_cume_dist,

if (prev_value != arg_val)
{
my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0));
my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0), func_name());
return true;
}

Expand Down Expand Up @@ -887,15 +887,15 @@ class Item_sum_percentile_cont : public Item_sum_cume_dist,
prev_value= arg->val_real();
if (prev_value > 1 || prev_value < 0)
{
my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0));
my_error(ER_ARGUMENT_OUT_OF_RANGE, MYF(0), func_name());
return true;
}
}

double arg_val= arg->val_real();
if (prev_value != arg_val)
{
my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0));
my_error(ER_ARGUMENT_NOT_CONSTANT, MYF(0), func_name());
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions sql/share/errmsg-utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7791,8 +7791,8 @@ ER_NOT_SINGLE_ELEMENT_ORDER_LIST
ER_WRONG_TYPE_FOR_PERCENTILE_FUNC
eng "Numeric datatype is required for %s function"
ER_ARGUMENT_NOT_CONSTANT
eng "Argument to the percentile functions is not a constant"
eng "Argument to the %s function is not a constant for a partition"
ER_ARGUMENT_OUT_OF_RANGE
eng "Argument to the percentile functions does not belong to the range [0,1]"
eng "Argument to the %s function does not belong to the range [0,1]"
ER_WRONG_TYPE_OF_ARGUMENT
eng "Numeric values are only allowed as arguments to percentile functions"
eng "%s function only accepts arguments that can be converted to numerical types"

0 comments on commit 4088791

Please sign in to comment.