summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_group.test
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 /mysql-test/t/func_group.test
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 'mysql-test/t/func_group.test')
-rw-r--r--mysql-test/t/func_group.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 96fd297dc20..b90fa49db93 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -537,3 +537,14 @@ CREATE TABLE t1 (id int(11),value1 float(10,2));
INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00), (2,13.00);
select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id;
DROP TABLE t1;
+
+#
+# BUG#8464 decimal AVG returns incorrect result
+#
+
+CREATE TABLE t1 (col1 decimal(16,12));
+INSERT INTO t1 VALUES (-5.00000000001),(-5.00000000002),(-5.00000000003),(-5.00000000000),(-5.00000000001),(-5.00000000002);
+insert into t1 select * from t1;
+select col1,count(col1),sum(col1),avg(col1) from t1 group by col1;
+DROP TABLE t1;
+