summaryrefslogtreecommitdiff
path: root/sql/my_decimal.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-02-11 14:40:35 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2020-02-11 14:40:35 +0100
commit646d1ec83a57d9a5b380079afc3612c1d9acadd5 (patch)
treeb46ec54915361f3baa221bcd01b4308a55c59c48 /sql/my_decimal.cc
parentc1eaa385ffb44bdf6264d2cc4b4cc0e10284c88a (diff)
parent58b70dc13630d2f2f0244359d6351085d70fd5dd (diff)
downloadmariadb-git-646d1ec83a57d9a5b380079afc3612c1d9acadd5.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/my_decimal.cc')
-rw-r--r--sql/my_decimal.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index b974026bb65..edf3e82de40 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -345,12 +345,12 @@ void my_decimal_trim(ulonglong *precision, uint *scale)
*/
int my_decimal2int(uint mask, const decimal_t *d, bool unsigned_flag,
- longlong *l)
+ longlong *l, decimal_round_mode round_type)
{
int res;
my_decimal rounded;
/* decimal_round can return only E_DEC_TRUNCATED */
- decimal_round(d, &rounded, 0, HALF_UP);
+ decimal_round(d, &rounded, 0, round_type);
res= (unsigned_flag ?
decimal2ulonglong(&rounded, (ulonglong *) l) :
decimal2longlong(&rounded, l));