diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-09-21 08:37:42 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-09-21 08:37:42 +0400 |
commit | 80bcb05b2451b89dd7e1355c9fde97c115b4bcb3 (patch) | |
tree | 05ea9ab3270e356039b90b1ab1ec12c5fa143b98 /sql/item_func.h | |
parent | 327b2717219aaa8f9033895a2351a6ccd4655116 (diff) | |
parent | e07118946a82af60c7cc3804c321d3fd9a49f128 (diff) | |
download | mariadb-git-80bcb05b2451b89dd7e1355c9fde97c115b4bcb3.tar.gz |
Merge remote-tracking branch 'origin/5.5' into 10.0
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 813bcf0d023..65c10c8bad5 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -418,7 +418,11 @@ public: String *val_str(String*str); my_decimal *val_decimal(my_decimal *decimal_value); longlong val_int() - { DBUG_ASSERT(fixed == 1); return (longlong) rint(val_real()); } + { + DBUG_ASSERT(fixed == 1); + bool error; + return double_to_longlong(val_real(), unsigned_flag, &error); + } enum Item_result result_type () const { return REAL_RESULT; } void fix_length_and_dec() { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); } @@ -1477,7 +1481,9 @@ class Item_func_udf_float :public Item_udf_func longlong val_int() { DBUG_ASSERT(fixed == 1); - return (longlong) rint(Item_func_udf_float::val_real()); + bool error; + return double_to_longlong(Item_func_udf_float::val_real(), + unsigned_flag, &error); } my_decimal *val_decimal(my_decimal *dec_buf) { |