diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-05-07 19:29:23 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-05-07 19:29:23 +0400 |
commit | da63db1e3b174209a4de1fe8e66e9bbe9ac3b11d (patch) | |
tree | 370a1a4185a509081ca87b5aa4df75a1141cdc5b /sql/item_sum.h | |
parent | 02ada41744382fea11621a5a8094cbbea06c9487 (diff) | |
download | mariadb-git-da63db1e3b174209a4de1fe8e66e9bbe9ac3b11d.tar.gz |
MDEV-12719 Determine Item::result_type() from Item::type_handler()
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 86ef54d8486..dee480ccf0a 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -748,7 +748,6 @@ public: double val_real() { DBUG_ASSERT(fixed == 1); return (double) val_int(); } String *val_str(String*str); my_decimal *val_decimal(my_decimal *); - enum Item_result result_type () const { return INT_RESULT; } const Type_handler *type_handler() const { return &type_handler_longlong; } void fix_length_and_dec() { decimals=0; max_length=21; maybe_null=null_value=0; } @@ -783,8 +782,6 @@ public: my_decimal *val_decimal(my_decimal *); const Type_handler *type_handler() const { return Type_handler_hybrid_field_type::type_handler(); } - enum Item_result result_type () const - { return Type_handler_hybrid_field_type::result_type(); } void fix_length_and_dec_double(); void fix_length_and_dec_decimal(); void reset_field(); @@ -976,7 +973,6 @@ public: { return sample ? "var_samp(" : "variance("; } Item *copy_or_same(THD* thd); Field *create_tmp_field(bool group, TABLE *table); - enum Item_result result_type () const { return REAL_RESULT; } const Type_handler *type_handler() const { return &type_handler_double; } void cleanup() { @@ -1048,8 +1044,6 @@ protected: } const Type_handler *type_handler() const { return Type_handler_hybrid_field_type::type_handler(); } - enum Item_result result_type () const - { return Type_handler_hybrid_field_type::result_type(); } void update_field(); void min_max_update_str_field(); void min_max_update_real_field(); @@ -1255,7 +1249,6 @@ public: Item_avg_field_double(THD *thd, Item_sum_avg *item) :Item_avg_field(thd, item) { } - enum Item_result result_type () const { return REAL_RESULT; } const Type_handler *type_handler() const { return &type_handler_double; } longlong val_int() { return val_int_from_real(); } my_decimal *val_decimal(my_decimal *dec) { return val_decimal_from_real(dec); } @@ -1276,7 +1269,6 @@ public: f_scale(item->f_scale), dec_bin_size(item->dec_bin_size) { } - enum Item_result result_type () const { return DECIMAL_RESULT; } const Type_handler *type_handler() const { return &type_handler_newdecimal; } double val_real() { return val_real_from_decimal(); } longlong val_int() { return val_int_from_decimal(); } @@ -1303,7 +1295,6 @@ public: { return val_decimal_from_real(dec_buf); } bool is_null() { update_null_value(); return null_value; } const Type_handler *type_handler() const { return &type_handler_double; } - enum Item_result result_type () const { return REAL_RESULT; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy<Item_variance_field>(thd, mem_root, this); } }; @@ -1401,7 +1392,6 @@ class Item_sum_udf_float :public Item_udf_sum double val_real(); String *val_str(String*str); my_decimal *val_decimal(my_decimal *); - enum Item_result result_type () const { return REAL_RESULT; } const Type_handler *type_handler() const { return &type_handler_double; } void fix_length_and_dec() { fix_num_length_and_dec(); } Item *copy_or_same(THD* thd); @@ -1424,7 +1414,6 @@ public: { DBUG_ASSERT(fixed == 1); return (double) Item_sum_udf_int::val_int(); } String *val_str(String*str); my_decimal *val_decimal(my_decimal *); - enum Item_result result_type () const { return INT_RESULT; } const Type_handler *type_handler() const { return &type_handler_longlong; } void fix_length_and_dec() { decimals=0; max_length=21; } Item *copy_or_same(THD* thd); @@ -1466,7 +1455,6 @@ public: return cs->cset->strtoll10(cs, res->ptr(), &end, &err_not_used); } my_decimal *val_decimal(my_decimal *dec); - enum Item_result result_type () const { return STRING_RESULT; } const Type_handler *type_handler() const { return string_type_handler(); } void fix_length_and_dec(); Item *copy_or_same(THD* thd); @@ -1488,7 +1476,6 @@ public: double val_real(); longlong val_int(); my_decimal *val_decimal(my_decimal *); - enum Item_result result_type () const { return DECIMAL_RESULT; } const Type_handler *type_handler() const { return &type_handler_newdecimal; } void fix_length_and_dec() { fix_num_length_and_dec(); } Item *copy_or_same(THD* thd); @@ -1564,7 +1551,6 @@ public: { DBUG_ASSERT(fixed == 1); null_value=1; return 0; } double val_real() { DBUG_ASSERT(fixed == 1); null_value=1; return 0.0; } longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; } - enum Item_result result_type () const { return STRING_RESULT; } void fix_length_and_dec() { maybe_null=1; max_length=0; } enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; } void clear() {} @@ -1638,7 +1624,6 @@ public: enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;} const char *func_name() const { return "group_concat("; } - virtual Item_result result_type () const { return STRING_RESULT; } const Type_handler *type_handler() const { if (too_big_for_varchar()) |