diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-03 19:17:05 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-03 19:17:05 +0100 |
commit | 0e007344eae972b9be7d88ca43373cb33662ac1c (patch) | |
tree | 7b3561cb3ea2ad24d013e847680ec165f406387e /sql/item_func.cc | |
parent | 3794110f0215f0631107c2694dc0f1675a4bb520 (diff) | |
parent | 681476255147dacac7e3674b6cd2ae770fee2208 (diff) | |
download | mariadb-git-0e007344eae972b9be7d88ca43373cb33662ac1c.tar.gz |
mysql-5.5.18 merge
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index bbfa3b74c5e..c765d142285 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1752,8 +1752,13 @@ longlong Item_func_int_div::val_int() return 0; } + my_decimal truncated; + const bool do_truncate= true; + if (my_decimal_round(E_DEC_FATAL_ERROR, &tmp, 0, do_truncate, &truncated)) + DBUG_ASSERT(false); + longlong res; - if (my_decimal2int(E_DEC_FATAL_ERROR, &tmp, unsigned_flag, &res) & + if (my_decimal2int(E_DEC_FATAL_ERROR, &truncated, unsigned_flag, &res) & E_DEC_OVERFLOW) raise_integer_overflow(); return res; @@ -5152,8 +5157,9 @@ longlong Item_func_get_user_var::val_int() */ -int get_var_with_binlog(THD *thd, enum_sql_command sql_command, - LEX_STRING &name, user_var_entry **out_entry) +static int +get_var_with_binlog(THD *thd, enum_sql_command sql_command, + LEX_STRING &name, user_var_entry **out_entry) { BINLOG_USER_VAR_EVENT *user_var_event; user_var_entry *var_entry; @@ -5283,7 +5289,7 @@ void Item_func_get_user_var::fix_length_and_dec() 'var_entry' is NULL only if there occured an error during the call to get_var_with_binlog. */ - if (var_entry) + if (!error && var_entry) { m_cached_result_type= var_entry->type; unsigned_flag= var_entry->unsigned_flag; |