summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <ramil@mysql.com>2005-11-30 11:17:25 +0400
committerunknown <ramil@mysql.com>2005-11-30 11:17:25 +0400
commit490a1e2855078d661b584ef690a05ca4defceebd (patch)
tree52f17b933d9481353fbb7a4d8bfe99acc842c9c9 /sql/item_sum.cc
parentd54359ffdada0d949931c7cbe1ba816c3724d49f (diff)
downloadmariadb-git-490a1e2855078d661b584ef690a05ca4defceebd.tar.gz
Addition to fix for bug #12956: cast make differ rounding.
- use rint() in some other val_int() methods as well.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 506d2a16108..626eb63d04f 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -452,7 +452,7 @@ longlong Item_sum_sum::val_int()
&result);
return result;
}
- return (longlong) val_real();
+ return (longlong) rint(val_real());
}
@@ -1285,7 +1285,7 @@ longlong Item_sum_hybrid::val_int()
return sum_int;
}
default:
- return (longlong) Item_sum_hybrid::val_real();
+ return (longlong) rint(Item_sum_hybrid::val_real());
}
}
@@ -2001,7 +2001,7 @@ double Item_avg_field::val_real()
longlong Item_avg_field::val_int()
{
- return (longlong) val_real();
+ return (longlong) rint(val_real());
}