summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-03-07 16:08:06 +0400
committerunknown <hf@deer.(none)>2005-03-07 16:08:06 +0400
commit07d5ddb75559f87a8286e93de0a4757c1aaa7ee4 (patch)
tree67d13c87ba3892a2ddde8bde4784bde2142770a3 /strings
parent0ae5efb4dc1df3af598030cf7b96b95841306c70 (diff)
downloadmariadb-git-07d5ddb75559f87a8286e93de0a4757c1aaa7ee4.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. mysql-test/r/func_group.result: appropriate test result mysql-test/t/func_group.test: test case added strings/decimal.c: in this case we also need to make fsizes equal
Diffstat (limited to 'strings')
-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++;