diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-09-30 12:37:34 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-09-30 12:37:34 +0400 |
commit | cc9cfecab78bde9376e4406bf24506e92fdaaeac (patch) | |
tree | 1ca3c873ef881d5e25be4aa390253f7eeb17c4ec /sql/item_timefunc.h | |
parent | 09b87d6293b4b41321ba98366d5d7ade9ad681d3 (diff) | |
download | mariadb-git-cc9cfecab78bde9376e4406bf24506e92fdaaeac.tar.gz |
MDEV-8865 Wrong field type or metadata for COALESCE(signed_int_column, unsigned_int_column)
Item_func_hybrid_field_type did not return correct field_type(), cmp_type()
and result_type() in some cases, because cached_result_type and
cached_field_type were set in independent pieces of the code and
did not properly match to each other.
Fix:
- Removing Item_func_hybrid_result_type
- Deriving Item_func_hybrid_field_type directly from Item_func
- Introducing a new class Type_handler which guarantees that
field_type(), cmp_type() and result_type() are always properly synchronized
and using the new class in Item_func_hybrid_field_type.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index edc77038f89..2d02a55b16a 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -421,7 +421,7 @@ public: set_if_smaller(decimals, TIME_SECOND_PART_DIGITS); max_length=17 + (decimals ? decimals + 1 : 0); maybe_null= true; - cached_result_type= decimals ? DECIMAL_RESULT : INT_RESULT; + set_handler_by_result_type(decimals ? DECIMAL_RESULT : INT_RESULT); } double real_op() { DBUG_ASSERT(0); return 0; } String *str_op(String *str) { DBUG_ASSERT(0); return 0; } |