mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug27229
This commit is contained in:
@ -3905,3 +3905,22 @@ COUNT(*) a
|
||||
2 2
|
||||
3 3
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
CREATE TABLE t2 (m int, n int);
|
||||
INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
|
||||
INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44);
|
||||
SELECT COUNT(*) c, a,
|
||||
(SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a)
|
||||
FROM t1 GROUP BY a;
|
||||
c a (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a)
|
||||
2 2 2
|
||||
3 3 3
|
||||
1 4 1,1
|
||||
SELECT COUNT(*) c, a,
|
||||
(SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a)
|
||||
FROM t1 GROUP BY a;
|
||||
c a (SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a)
|
||||
2 2 3
|
||||
3 3 4
|
||||
1 4 2,2
|
||||
DROP table t1,t2;
|
||||
|
@ -2763,3 +2763,22 @@ SELECT COUNT(*), a
|
||||
HAVING (SELECT MIN(m) FROM t2 WHERE m = count(*)) > 1;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug #27229: GROUP_CONCAT in subselect with COUNT() as an argument
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
CREATE TABLE t2 (m int, n int);
|
||||
INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4);
|
||||
INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44);
|
||||
|
||||
SELECT COUNT(*) c, a,
|
||||
(SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a)
|
||||
FROM t1 GROUP BY a;
|
||||
|
||||
SELECT COUNT(*) c, a,
|
||||
(SELECT GROUP_CONCAT(COUNT(a)+1) FROM t2 WHERE m = a)
|
||||
FROM t1 GROUP BY a;
|
||||
|
||||
DROP table t1,t2;
|
||||
|
Reference in New Issue
Block a user