Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregate function calls cannot be nested, should result error #35347

Open
ramanich1 opened this issue Jun 13, 2022 · 0 comments
Open

aggregate function calls cannot be nested, should result error #35347

ramanich1 opened this issue Jun 13, 2022 · 0 comments
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 affects-6.6 severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ramanich1
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1,t2;
CREATE TABLE t1 (a INT); INSERT INTO t1 values (1),(1),(1),(1);
CREATE TABLE t2 (x INT); INSERT INTO t1 values (1000),(1001),(1002);
SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1;

2. What did you expect to see? (Required)

mysql> SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1;
ERROR 1111 (HY000): Invalid use of group function

3. What did you see instead (Required)

mysql> SELECT SUM( (SELECT COUNT(a) FROM t2) ) FROM t1;
+----------------------------------+
| SUM( (SELECT COUNT(a) FROM t2) ) |
+----------------------------------+
|                                0 |
+----------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

mysql> select version();
+-----------------------------------------------+
| version()                                     |
+-----------------------------------------------+
| 5.7.25-TiDB-v6.1.0-alpha-482-g81a852077-dirty |
+-----------------------------------------------+
@ramanich1 ramanich1 added the type/bug The issue is confirmed as a bug. label Jun 13, 2022
@ChenPeng2013 ChenPeng2013 added sig/planner SIG: Planner severity/major affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 labels Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 affects-6.6 severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants