summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-10-27 20:04:05 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-11-01 23:17:15 +0530
commitab5503c8c5aca9c672db5ceb2c3636b598290a21 (patch)
tree9e3b1a3c6ba965f8791afe9735d5aa7a0a154c49 /sql
parent40887913ff4bb135d1b11495cd60c7a6f9402b8d (diff)
downloadmariadb-git-ab5503c8c5aca9c672db5ceb2c3636b598290a21.tar.gz
Updates the tests for the percentile functions
Diffstat (limited to 'sql')
-rw-r--r--sql/item_windowfunc.cc8
-rw-r--r--sql/item_windowfunc.h14
-rw-r--r--sql/sql_window.cc2
3 files changed, 12 insertions, 12 deletions
diff --git a/sql/item_windowfunc.cc b/sql/item_windowfunc.cc
index d38befa66bc..8432ab43ad8 100644
--- a/sql/item_windowfunc.cc
+++ b/sql/item_windowfunc.cc
@@ -174,11 +174,11 @@ bool Item_window_func::check_result_type_of_order_item()
if (only_single_element_order_list())
{
Item_result rtype= window_spec->order_list->first->item[0]->cmp_type();
- // TODO (varun) : support date type in percentile_cont function
+ // TODO (varun) : support date type in percentile_cont function
if (rtype != REAL_RESULT && rtype != INT_RESULT &&
rtype != DECIMAL_RESULT && rtype != TIME_RESULT)
{
- my_error(ER_WRONG_TYPE_FOR_PERCENTILE_FUNC, MYF(0));
+ my_error(ER_WRONG_TYPE_FOR_PERCENTILE_FUNC, MYF(0), window_func()->func_name());
return TRUE;
}
setting_handler_for_percentile_functions(rtype);
@@ -249,7 +249,7 @@ bool Item_sum_percentile_cont::fix_fields(THD *thd, Item **ref)
case INT_RESULT:
break;
default:
- my_error(ER_WRONG_TYPE_OF_ARGUMENT, MYF(0));
+ my_error(ER_WRONG_TYPE_OF_ARGUMENT, MYF(0), func_name());
return TRUE;
}
return res;
@@ -268,7 +268,7 @@ bool Item_sum_percentile_disc::fix_fields(THD *thd, Item **ref)
case INT_RESULT:
break;
default:
- my_error(ER_WRONG_TYPE_OF_ARGUMENT, MYF(0));
+ my_error(ER_WRONG_TYPE_OF_ARGUMENT, MYF(0), func_name());
return TRUE;
}
return res;
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index a3056dc222a..849c298f5aa 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -786,7 +786,7 @@ public:
value->store(order_item);
value->cache_value();
if (value->null_value)
- return false;
+ return false;
Item_sum_cume_dist::add();
double val= Item_sum_cume_dist::val_real();
@@ -821,7 +821,7 @@ public:
void fix_length_and_dec()
{
- decimals = 5; // TODO-cvicentiu find out how many decimals the standard
+ decimals = 10; // TODO-cvicentiu find out how many decimals the standard
// requires.
}
@@ -904,24 +904,24 @@ public:
floor_value->store(order_item);
floor_value->cache_value();
if (floor_value->null_value)
- return false;
+ return false;
}
if (floor_val_calculated && !ceil_val_calculated)
{
ceil_value->store(order_item);
ceil_value->cache_value();
if (ceil_value->null_value)
- return false;
+ return false;
}
Item_sum_cume_dist::add();
double val= 1 + prev_value * (get_row_count()-1);
if (!floor_val_calculated && get_row_number() == floor(val))
- floor_val_calculated= true;
+ floor_val_calculated= true;
if (!ceil_val_calculated && get_row_number() == ceil(val))
- ceil_val_calculated= true;
+ ceil_val_calculated= true;
return false;
}
@@ -951,7 +951,7 @@ public:
void fix_length_and_dec()
{
- decimals = 5; // TODO-cvicentiu find out how many decimals the standard
+ decimals = 10; // TODO-cvicentiu find out how many decimals the standard
// requires.
}
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index 059dd8073f5..4bcdca3ca11 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -1765,7 +1765,7 @@ protected:
}
};
-class Frame_unbounded_following_set_count_no_nulls:
+class Frame_unbounded_following_set_count_no_nulls:
public Frame_unbounded_following_set_count
{