Skip to content
Permalink
Browse files
has_error field added to the item_sum class. This field ensures that …
…query is terminated

if we get any error during the add function call. This is currently used only for the
percentile functions
  • Loading branch information
varunraiko committed Nov 1, 2017
1 parent 64a2a30 commit 3305779
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
@@ -441,6 +441,7 @@ Item_sum::Item_sum(THD *thd, List<Item> &list): Item_func_or_sum(thd, list)
mark_as_sum_func();
init_aggregator();
list.empty(); // Fields are used
has_error= FALSE;
}


@@ -452,7 +453,7 @@ Item_sum::Item_sum(THD *thd, Item_sum *item):
Item_func_or_sum(thd, item),
aggr_sel(item->aggr_sel),
nest_level(item->nest_level), aggr_level(item->aggr_level),
quick_group(item->quick_group),
quick_group(item->quick_group), has_error(FALSE),
orig_args(NULL)
{
if (arg_count <= 2)
@@ -367,6 +367,7 @@ class Item_sum :public Item_func_or_sum
int8 max_arg_level; /* max level of unbound column references */
int8 max_sum_func_level;/* max level of aggregation for embedded functions */
bool quick_group; /* If incremental update of fields */
bool has_error;
/*
This list is used by the check for mixing non aggregated fields and
sum functions in the ONLY_FULL_GROUP_BY_MODE. We save all outer fields
@@ -388,19 +389,19 @@ class Item_sum :public Item_func_or_sum
public:

void mark_as_sum_func();
Item_sum(THD *thd): Item_func_or_sum(thd), quick_group(1)
Item_sum(THD *thd): Item_func_or_sum(thd), quick_group(1), has_error(0)
{
mark_as_sum_func();
init_aggregator();
}
Item_sum(THD *thd, Item *a): Item_func_or_sum(thd, a), quick_group(1),
orig_args(tmp_orig_args)
has_error(0), orig_args(tmp_orig_args)
{
mark_as_sum_func();
init_aggregator();
}
Item_sum(THD *thd, Item *a, Item *b): Item_func_or_sum(thd, a, b),
quick_group(1), orig_args(tmp_orig_args)
quick_group(1), has_error(0), orig_args(tmp_orig_args)
{
mark_as_sum_func();
init_aggregator();

0 comments on commit 3305779

Please sign in to comment.