-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
unexpected error: ERROR 1111 (HY000): Invalid use of group function
#17852
Comments
minor case: select (select a.id from t a where a.id = max(b.id)) AS c from t b;
|
I doubt whether it is a bug in TiDB. If I understand correctly, this query violated |
@zhangysh1995 No, it has nothing to do with You can check it in MySQL. |
I mean it could be a bug in MySQL. @XuHuaiyu |
This is the doc for handling |
change the ”where“ to "having" it can solve this problem |
Can this issue be closed now? @XuHuaiyu |
After testing, this problem still exists. |
@XuHuaiyu is there any update of this issue? |
Fixed in master. Not sure when is fixed |
It is still happened in master 298ce91. It works in MySQL 8.0. CREATE TABLE student (id int(11) DEFAULT NULL,
student_name varchar (20) DEFAULT NULL,
test_score int (11) DEFAULT NULL
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
select (SELECT @ids:=GROUP_CONCAT(test_score) FROM student where find_in_set(student_name,@ids)) from student; This case with a user var in it. The stack:
|
create a new issue #38600, so close this one |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. Affected version (Required)
5. Root Cause Analysis
error log:
The text was updated successfully, but these errors were encountered: