summaryrefslogtreecommitdiff
path: root/sql/my_decimal.cc
diff options
context:
space:
mode:
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));