summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2005-12-02 20:42:36 -0800
committerigor@rurik.mysql.com <>2005-12-02 20:42:36 -0800
commit09e6597015d432e07bc14aefb61b60236d797b40 (patch)
treea7f18b069781ad44463394d0a6a6a4d7f37b560a /sql/item_sum.h
parent9b9f8cab4cf2d682077881c93adb57c7ca05c9e7 (diff)
parent997f7027aea4682ad57f1e2185ce311406fe9b6c (diff)
downloadmariadb-git-09e6597015d432e07bc14aefb61b60236d797b40.tar.gz
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 6bc4af1b836..eddc3ed8446 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -330,7 +330,7 @@ public:
longlong val_int()
{
DBUG_ASSERT(fixed == 1);
- return (longlong) val_real(); /* Real as default */
+ return (longlong) rint(val_real()); /* Real as default */
}
String *val_str(String*str);
my_decimal *val_decimal(my_decimal *);
@@ -596,7 +596,7 @@ public:
bool add();
double val_real();
// In SPs we might force the "wrong" type with select into a declare variable
- longlong val_int() { return (longlong)val_real(); }
+ longlong val_int() { return (longlong) rint(val_real()); }
my_decimal *val_decimal(my_decimal *);
String *val_str(String *str);
void reset_field();
@@ -625,7 +625,7 @@ public:
enum Type type() const {return FIELD_VARIANCE_ITEM; }
double val_real();
longlong val_int()
- { /* can't be fix_fields()ed */ return (longlong) val_real(); }
+ { /* can't be fix_fields()ed */ return (longlong) rint(val_real()); }
String *val_str(String*);
my_decimal *val_decimal(my_decimal *);
bool is_null() { (void) val_int(); return null_value; }
@@ -903,7 +903,7 @@ class Item_sum_udf_float :public Item_udf_sum
longlong val_int()
{
DBUG_ASSERT(fixed == 1);
- return (longlong) Item_sum_udf_float::val_real();
+ return (longlong) rint(Item_sum_udf_float::val_real());
}
double val_real();
String *val_str(String*str);