diff options
author | Sergey Glukhov <sergey.glukhov@oracle.com> | 2011-03-28 17:33:35 +0400 |
---|---|---|
committer | Sergey Glukhov <sergey.glukhov@oracle.com> | 2011-03-28 17:33:35 +0400 |
commit | 8cca70e0368494da6373814e0ed8934a2a56bec2 (patch) | |
tree | 3dbaeee1ed164d6db4c509e6e98b07a5170fb903 /sql | |
parent | b9b40a0c29dfaa74afe85e835b0ee29fadd20433 (diff) | |
parent | 47885f552b1822291584b71c791fd5175ba6567f (diff) | |
download | mariadb-git-8cca70e0368494da6373814e0ed8934a2a56bec2.tar.gz |
5.1 -> 5.5 merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_func.cc | 5 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 0f6321244be..427910c3625 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -505,7 +505,10 @@ bool Item_func::is_expensive_processor(uchar *arg) my_decimal *Item_func::val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed); - int2my_decimal(E_DEC_FATAL_ERROR, val_int(), unsigned_flag, decimal_value); + longlong nr= val_int(); + if (null_value) + return 0; /* purecov: inspected */ + int2my_decimal(E_DEC_FATAL_ERROR, nr, unsigned_flag, decimal_value); return decimal_value; } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index c277e538999..c2363409269 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -3405,6 +3405,7 @@ void Item_func_str_to_date::fix_length_and_dec() { maybe_null= 1; decimals=0; + cached_format_type= DATE_TIME; cached_field_type= MYSQL_TYPE_DATETIME; max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; cached_timestamp_type= MYSQL_TIMESTAMP_NONE; |