From b8e5df4b7d2da080f9010d342538fea8b827963c Mon Sep 17 00:00:00 2001 From: "hf@deer.(none)" <> Date: Mon, 7 Mar 2005 16:08:06 +0400 Subject: Fix for bug #8464 (AVG returns incorrect result) Actually problem was not in AVG function, but in SUM before the AVG in the query. --- strings/decimal.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'strings/decimal.c') 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++; -- cgit v1.2.1