diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-03-27 17:28:23 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-03-28 07:52:14 +0400 |
commit | 3e1f3d3e2f14a157121b92bd4b76e986f1846454 (patch) | |
tree | 107b71202aec634fabff24296d55a0f6e353496c /sql/item_sum.h | |
parent | f78eb52fba4c5709f9c0b246eb6663774a9ff317 (diff) | |
download | mariadb-git-3e1f3d3e2f14a157121b92bd4b76e986f1846454.tar.gz |
A cleanup in Item_sum: removing dead code
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 50e41990b13..3600f625f3f 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -722,24 +722,16 @@ public: class Item_sum_num :public Item_sum { -protected: - /* - val_xxx() functions may be called several times during the execution of a - query. Derived classes that require extensive calculation in val_xxx() - maintain cache of aggregate value. This variable governs the validity of - that cache. - */ - bool is_evaluated; public: - Item_sum_num(THD *thd): Item_sum(thd), is_evaluated(FALSE) {} + Item_sum_num(THD *thd): Item_sum(thd) {} Item_sum_num(THD *thd, Item *item_par): - Item_sum(thd, item_par), is_evaluated(FALSE) {} + Item_sum(thd, item_par) {} Item_sum_num(THD *thd, Item *a, Item* b): - Item_sum(thd, a, b), is_evaluated(FALSE) {} + Item_sum(thd, a, b) {} Item_sum_num(THD *thd, List<Item> &list): - Item_sum(thd, list), is_evaluated(FALSE) {} + Item_sum(thd, list) {} Item_sum_num(THD *thd, Item_sum_num *item): - Item_sum(thd, item),is_evaluated(item->is_evaluated) {} + Item_sum(thd, item) {} bool fix_fields(THD *, Item **); longlong val_int() { return val_int_from_real(); /* Real as default */ } String *val_str(String*str); @@ -748,7 +740,6 @@ public: { return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate); } - void reset_field(); }; @@ -1705,6 +1696,7 @@ class Item_sum_udf_float :public Item_sum_num double val_real() { DBUG_ASSERT(fixed == 1); return 0.0; } void clear() {} bool add() { return 0; } + void reset_field() { DBUG_ASSERT(0); }; void update_field() {} }; @@ -1723,6 +1715,7 @@ public: double val_real() { DBUG_ASSERT(fixed == 1); return 0; } void clear() {} bool add() { return 0; } + void reset_field() { DBUG_ASSERT(0); }; void update_field() {} }; @@ -1741,6 +1734,7 @@ class Item_sum_udf_decimal :public Item_sum_num my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed == 1); return 0; } void clear() {} bool add() { return 0; } + void reset_field() { DBUG_ASSERT(0); }; void update_field() {} }; @@ -1762,6 +1756,7 @@ public: enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; } void clear() {} bool add() { return 0; } + void reset_field() { DBUG_ASSERT(0); }; void update_field() {} }; |