-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Bug Report: false negative sql_mode=only_full_group_by error message from vtgate #9889
Comments
VTGate runs in this mode and will not allow such queries down. |
Sorry, I'm not sure I understand - the query, semantically, is fundamentally supported, as I mention in the issue report. It worked as-is in version 11, even. The bug is that, after upgrading to version 13, introducing table aliases to the query breaks the support. Are you saying that table aliases are not currently supported in this circumstance? |
Hello @Santiclause, this has been fixed on |
TO follow up on this: the following query structure continues to error with both #10069 and #10074 compiled in:
In this situation, yielding
This happens even if we include the hint |
Hi @frouioui we compiled and tested this branch on our staging vtgates as you instructed: vitessio/vitess/tree/fix-9889-only-full-group-by-upstream And it seems to successfully eliminate the problem as described in this issue! Thank you so much for your work in resolving this bug! |
Overview of the Issue
Issuing a query with aggregation which selects a non-aggregated column which is also not in the group by clause will fail with the error
Expression of SELECT list is not in GROUP BY clause and contains nonaggregated column [...] which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
. This error message indicates that the problem is withsql_mode
, but there is nosql_mode
setting involved here; this error happens at the vtgate before it reaches any tablets, and occurs irrespective of your actualsql_mode
setting on your tablets (we do not have thisonly_full_group_by
setting set).It also appears that the query has to have table aliasing in order to run into this problem.
Reproduction Steps
Example vschema:
Example schema:
Observe that the following query succeeds:
Yet this query, identical in all respects other than table alias, fails:
Binary Version
Operating System and Environment details
Log Fragments
The text was updated successfully, but these errors were encountered: