summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_group.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-03-19 23:12:50 -0800
committerunknown <igor@rurik.mysql.com>2005-03-19 23:12:50 -0800
commit2ba3544f0e053d95e82b9a899fd9b86cbb19b9ce (patch)
tree0e3fe377a3d0bffc62ae802033d88c4b9a4dc510 /mysql-test/r/func_group.result
parent648d40ea663aecb584c832380a4309a127d7c2a5 (diff)
downloadmariadb-git-2ba3544f0e053d95e82b9a899fd9b86cbb19b9ce.tar.gz
func_group.test, func_group.result:
Added a test case for bug #9210. sql_select.cc: Fixed bug #9210. The function calc_group_buffer did not cover the case when the GROUP BY expression was decimal. Slightly optimized the other code. sql/sql_select.cc: Fixed bug #9210. The function calc_group_buffer did not cover the case when the GROUP by expression was decimal. Slightly optimized the other code. mysql-test/t/func_group.test: Added a test case for bug #9210.
Diffstat (limited to 'mysql-test/r/func_group.result')
-rw-r--r--mysql-test/r/func_group.result59
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 81663cd9d66..3e06018226d 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -888,3 +888,62 @@ SELECT COUNT(DISTINCT a) FROM t1;
COUNT(DISTINCT a)
2
DROP TABLE t1;
+CREATE TABLE t1 (a int, b int, c int);
+INSERT INTO t1 (a, b, c) VALUES
+(1,1,1), (1,1,2), (1,1,3),
+(1,2,1), (1,2,2), (1,2,3),
+(1,3,1), (1,3,2), (1,3,3),
+(2,1,1), (2,1,2), (2,1,3),
+(2,2,1), (2,2,2), (2,2,3),
+(2,3,1), (2,3,2), (2,3,3),
+(3,1,1), (3,1,2), (3,1,3),
+(3,2,1), (3,2,2), (3,2,3),
+(3,3,1), (3,3,2), (3,3,3);
+SELECT b/c as v, a FROM t1 ORDER BY v;
+v a
+0.33333 3
+0.33333 1
+0.33333 2
+0.50000 1
+0.50000 2
+0.50000 3
+0.66667 2
+0.66667 1
+0.66667 3
+1.00000 3
+1.00000 2
+1.00000 3
+1.00000 1
+1.00000 2
+1.00000 3
+1.00000 2
+1.00000 1
+1.00000 1
+1.50000 3
+1.50000 2
+1.50000 1
+2.00000 1
+2.00000 3
+2.00000 2
+3.00000 3
+3.00000 2
+3.00000 1
+SELECT b/c as v, SUM(a) FROM t1 GROUP BY v;
+v SUM(a)
+0.33333 6
+0.50000 6
+0.66667 6
+1.00000 18
+1.50000 6
+2.00000 6
+3.00000 6
+SELECT SUM(a) FROM t1 GROUP BY b/c;
+SUM(a)
+6
+6
+6
+18
+6
+6
+6
+DROP TABLE t1;