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> #274

Closed
kaklakariada opened this issue Jul 10, 2023 · 1 comment
Closed

VS Workaround for GROUP BY <integer> #274

kaklakariada opened this issue Jul 10, 2023 · 1 comment
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
@kaklakariada
Copy link
Contributor Author

This project is not affected. The issue must be fixed in exasol/virtual-schema-common-jdbc#149

@kaklakariada kaklakariada closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
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

No branches or pull requests

1 participant