summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-09-20 16:02:58 +0400
committerAlexander Barkov <bar@mariadb.com>2018-09-20 16:02:58 +0400
commit0c6455aa4658790439a58956f05df200a5e380b8 (patch)
treeb792c811420d76f7b6edc079f1a7e9923aebe9b0 /sql/item_sum.cc
parente43bc02e7b2752f0deb88cd1edc24d827e01dca9 (diff)
downloadmariadb-git-0c6455aa4658790439a58956f05df200a5e380b8.tar.gz
MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 16334cd7b30..22fbe2bacfe 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1434,7 +1434,8 @@ longlong Item_sum_sum::val_int()
&result);
return result;
}
- return (longlong) rint(val_real());
+ bool error;
+ return double_to_longlong(val_real(), unsigned_flag, &error);
}
@@ -2648,7 +2649,8 @@ double Item_avg_field::val_real()
longlong Item_avg_field::val_int()
{
- return (longlong) rint(val_real());
+ bool error;
+ return double_to_longlong(val_real(), unsigned_flag, &error);
}