Details
Description
Select from view fails with error "Invalid use of group function" if definition of view has 'GROUP_CONCAT(COUNT(a))' in query.
Test:
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); |
|
CREATE VIEW v1 AS SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c |
FROM t1 GROUP BY a; |
|
SELECT * FROM v1; |
|
DROP VIEW v1; |
DROP table t1,t2; |
Actual result:
At line 9: query 'SELECT * FROM v1' failed: 1111: Invalid use of group function |
Expected result:
c
|
2
|
3
|
1,1
|
Attachments
Issue Links
- duplicates
-
MDEV-30668 Set function aggregated in outer select used in view definition
- Closed
- is part of
-
MDEV-27691 make working view-protocol
- Open