summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorhf@deer.(none) <>2005-03-07 16:08:06 +0400
committerhf@deer.(none) <>2005-03-07 16:08:06 +0400
commitb8e5df4b7d2da080f9010d342538fea8b827963c (patch)
tree67d13c87ba3892a2ddde8bde4784bde2142770a3 /strings/decimal.c
parent9ca989aff24f4c692709405246d649403d6501fa (diff)
downloadmariadb-git-b8e5df4b7d2da080f9010d342538fea8b827963c.tar.gz
Fix for bug #8464 (AVG returns incorrect result)
Actually problem was not in AVG function, but in SUM before the AVG in the query.
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index e6d2d9b14dd..90e64ae892f 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1199,7 +1199,10 @@ int decimal2bin(decimal *from, char *to, int precision, int frac)
else if (fsize0 > fsize1 && frac1x)
{
if (frac0 == frac1)
+ {
frac1x=frac0x;
+ fsize0= fsize1;
+ }
else
{
frac1++;