summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-02 12:49:19 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-02 12:49:19 +0200
commit09a1f0075a8d5752dd7b2940a20d86a040af1741 (patch)
tree42c96cf95d5df2950b77329c76c0024f33088aff /sql/item_func.cc
parente6f95b23f425001a14a528256354e0faf4e272f6 (diff)
parent440d4b282dd4992d64abdd6289859598db7e5f75 (diff)
downloadmariadb-git-09a1f0075a8d5752dd7b2940a20d86a040af1741.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 8a75d2c9946..027488e0279 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -640,8 +640,7 @@ void Item_func::print_op(String *str, enum_query_type query_type)
str->append(func_name());
str->append(' ');
}
- args[arg_count-1]->print_parenthesised(str, query_type,
- (enum precedence)(precedence() + 1));
+ args[arg_count-1]->print_parenthesised(str, query_type, higher_precedence());
}
@@ -1493,14 +1492,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)
{
@@ -1509,7 +1507,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;
}
@@ -4017,6 +4014,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. */