diff options
author | Varun Gupta <varunraiko1803@gmail.com> | 2017-07-17 13:25:08 +0530 |
---|---|---|
committer | Varun Gupta <varunraiko1803@gmail.com> | 2017-11-01 23:13:01 +0530 |
commit | 330577988f23bcee35fb3956d35d9c51f410ea46 (patch) | |
tree | 825993b9700d12f8c0772f39eba0d6882d06222f | |
parent | 64a2a3029577e1539bcf029c73d616b40b657b1c (diff) | |
download | mariadb-git-330577988f23bcee35fb3956d35d9c51f410ea46.tar.gz |
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
-rw-r--r-- | sql/item_sum.cc | 3 | ||||
-rw-r--r-- | sql/item_sum.h | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index b047dc4ea4d..4f9cdfe20e8 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -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) diff --git a/sql/item_sum.h b/sql/item_sum.h index 467a77c8983..a3bcf397db7 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -367,6 +367,7 @@ public: 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 @@ protected: 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(); |