diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 14:49:17 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-03 14:49:17 +0200 |
commit | 533a13af069d8c9e6c5f4e1a72851497185ade03 (patch) | |
tree | 4623752e0c114e582fbbc0afcc02b67dede26b50 /sql/item_func.cc | |
parent | 4b3690b50433a169d9feed5dc45044a8934b5582 (diff) | |
parent | e6290a8270daf884f551230307225b358939bfab (diff) | |
download | mariadb-git-533a13af069d8c9e6c5f4e1a72851497185ade03.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 7a15f919742..837156ce39a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1481,14 +1481,13 @@ double Item_func_div::real_op() my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) { int err; - my_decimal tmp; VDec2_lazy val(args[0], args[1]); if ((null_value= val.has_null())) return 0; if ((err= check_decimal_overflow(my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_OVERFLOW & ~E_DEC_DIV_ZERO, - &tmp, + decimal_value, val.m_a.ptr(), val.m_b.ptr(), prec_increment))) > 3) { @@ -1497,7 +1496,6 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value) null_value= 1; return 0; } - tmp.round_to(decimal_value, decimals, HALF_UP); return decimal_value; } @@ -3928,6 +3926,8 @@ int Interruptible_wait::wait(mysql_cond_t *cond, mysql_mutex_t *mutex) timeout= m_abs_timeout; error= mysql_cond_timedwait(cond, mutex, &timeout); + if (m_thd->check_killed()) + break; if (error == ETIMEDOUT || error == ETIME) { /* Return error if timed out or connection is broken. */ @@ -4774,7 +4774,8 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, size_t length, length--; // Fix length change above entry->value[length]= 0; // Store end \0 } - memmove(entry->value, ptr, length); + if (length) + memmove(entry->value, ptr, length); if (type == DECIMAL_RESULT) ((my_decimal*)entry->value)->fix_buffer_pointer(); entry->length= length; |