diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-12-01 13:13:23 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-12-01 13:13:23 +0400 |
commit | 607ef786fc50b44b8e0cb4af8fdb3c79e4a327bb (patch) | |
tree | 72c8d7e9bc632b593e485f853a211cc839446ea7 /sql/item_sum.h | |
parent | e3fed3b9b4f488e9ad1afa57333ae80249e6cb17 (diff) | |
download | mariadb-git-607ef786fc50b44b8e0cb4af8fdb3c79e4a327bb.tar.gz |
MDEV-9215 Detect cmp_type() and result_type() from field_type()
(A dependency task for MDEV-4912 Add a plugin to field types)
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index db3312c42f4..151b913f121 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -715,6 +715,7 @@ public: String *val_str(String*str); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals=0; max_length=21; maybe_null=null_value=0; } }; @@ -747,6 +748,10 @@ public: String *val_str(String*str); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return hybrid_type; } + enum_field_types field_type() const + { + return field_type_by_result_type(); + } void reset_field(); void update_field(); void no_rows_in_result() {} @@ -1258,6 +1263,9 @@ 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; } + enum Item_result cmp_type () const { return REAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } void fix_length_and_dec() { fix_num_length_and_dec(); } Item *copy_or_same(THD* thd); }; @@ -1278,6 +1286,7 @@ public: String *val_str(String*str); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return INT_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; } void fix_length_and_dec() { decimals=0; max_length=21; } Item *copy_or_same(THD* thd); }; @@ -1317,6 +1326,7 @@ public: } my_decimal *val_decimal(my_decimal *dec); enum Item_result result_type () const { return STRING_RESULT; } + enum_field_types field_type() const { return string_field_type(); } void fix_length_and_dec(); Item *copy_or_same(THD* thd); }; @@ -1336,6 +1346,7 @@ public: longlong val_int(); my_decimal *val_decimal(my_decimal *); enum Item_result result_type () const { return DECIMAL_RESULT; } + enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } void fix_length_and_dec() { fix_num_length_and_dec(); } Item *copy_or_same(THD* thd); }; @@ -1484,6 +1495,7 @@ 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; } + virtual Item_result cmp_type () const { return STRING_RESULT; } virtual Field *make_string_field(TABLE *table); enum_field_types field_type() const { |