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

VS Workaround for GROUP BY <integer> #149

Closed
kaklakariada opened this issue Jul 10, 2023 · 0 comments · Fixed by #150
Closed

VS Workaround for GROUP BY <integer> #149

kaklakariada opened this issue Jul 10, 2023 · 0 comments · Fixed by #150
Assignees
Labels
bug Unwanted / harmful behavior

Comments

@kaklakariada
Copy link
Contributor

Summary

When users combine integer constants as expressions with DISTINCT, the engine pushes down GROUP BY <integer-constant>. Exasol interprets this as "group by column number", which yields wrong results. What should happen here is that you get a result with a single group. GROUP BY TRUE, GROUP BY '0' or any other non-integer constant will work as expected.

Note that some databases interpret this as "group by integer constant". So the behavior is database specific. The reason is that this case is not covered by the SQL standard.

Workaround:

The adapter should work around this by turning GROUP BY <integer-constant> into GROUP BY <other-constant>.

Theoretically that should be done on a db-by-db basis, but that is too much effort, so a general workaround in VSCL and VSCJ should be implemented. This can be overridden in the dialect if there is ever the need.

Features

  • Turns GROUP BY <integer-constant> into GROUP BY <other-constant>
@kaklakariada kaklakariada added the bug Unwanted / harmful behavior label Jul 10, 2023
@kaklakariada kaklakariada self-assigned this Jul 10, 2023
@redcatbear redcatbear self-assigned this Jul 10, 2023
kaklakariada added a commit that referenced this issue Jul 11, 2023
Co-authored-by: Sebastian Bär <sebastian.baer@exasol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted / harmful behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants