summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-09-23 12:58:11 +0200
committerSergei Golubchik <serg@mariadb.org>2018-09-23 12:58:11 +0200
commit1fc5a6f30c3a9c047dcf9a36b00026d98f286f6b (patch)
tree0aa792118101ee3130b25b47316159aaccec52e2 /sql/item_func.h
parent87dc4e98dda26ff99a3b3aeae2fce9fd2f2fdf24 (diff)
parent1144acbcbdf9b7bdf18c31f88cbe859d99658b53 (diff)
downloadmariadb-git-1fc5a6f30c3a9c047dcf9a36b00026d98f286f6b.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 3219c813821..2c0e3a62f6a 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -382,7 +382,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)
{