diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-09-20 16:02:58 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-09-20 16:02:58 +0400 |
commit | 0c6455aa4658790439a58956f05df200a5e380b8 (patch) | |
tree | b792c811420d76f7b6edc079f1a7e9923aebe9b0 /sql/item.cc | |
parent | e43bc02e7b2752f0deb88cd1edc24d827e01dca9 (diff) | |
download | mariadb-git-0c6455aa4658790439a58956f05df200a5e380b8.tar.gz |
MDEV-17249 MAKETIME(-1e50,0,0) returns a wrong result
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc index 745cbf31f0c..e1afc339cc2 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3692,7 +3692,10 @@ longlong Item_param::val_int() { switch (state) { case REAL_VALUE: - return (longlong) rint(value.real); + { + bool error; + return double_to_longlong(value.real, unsigned_flag, &error); + } case INT_VALUE: return value.integer; case DECIMAL_VALUE: @@ -9231,7 +9234,8 @@ longlong Item_cache_real::val_int() DBUG_ASSERT(fixed == 1); if (!has_value()) return 0; - return (longlong) rint(value); + bool error; + return double_to_longlong(value, unsigned_flag, &error); } |