1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

a fix (bug #7405: group_concat with distinct and rollup => ignores distinct in some rows).

This commit is contained in:
ramil@mysql.com
2005-05-31 10:54:33 +05:00
parent e8a6fa4278
commit cc0061a122
3 changed files with 49 additions and 29 deletions

View File

@@ -469,3 +469,26 @@ x (select group_concat(x) from r2)
1 1,1
2 2,2
drop table r2;
create table t1 (d int, a int, b int, c int);
insert into t1(a,b) values (1,3), (1,4), (1,2), (2,7), (1,1), (1,2), (2,3), (2,3);
select a, group_concat(b) from t1 group by a with rollup;
a group_concat(b)
1 3,4,2,1,2
2 7,3,3
NULL 3,4,2,1,2,7,3,3
select a, group_concat(distinct b) from t1 group by a with rollup;
a group_concat(distinct b)
1 3,4,2,1
2 7,3
NULL 3,4,2,1,7
select a, group_concat(b order by b) from t1 group by a with rollup;
a group_concat(b order by b)
1 1,2,2,3,4
2 3,3,7
NULL 1,2,2,3,3,3,4,7
select a, group_concat(distinct b order by b) from t1 group by a with rollup;
a group_concat(distinct b order by b)
1 1,2,3,4
2 3,7
NULL 1,2,3,4,7
drop table t1;