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

fix: EXPOSED-302 Count with alias fails if table name includes schema #2008

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

bog-walk
Copy link
Member

Attempting to use count() in a query that requires an alias (for example, with DISTINCT, GROUP BY, or LIMIT clauses) throws a syntax exception if the table name includes the schema name.

This occurs because the alias name created in count() concatenates the full table name with a dot character.

The alias now uses the table name without a schema prefix and sanitized of quotations, if present.

Attempting to use count() in a query that requires an alias (for example, with
DISTINCT, GROUP BY, or LIMIT clauses) throws a syntax exception if the table name
includes the schema name.

This occurs because the alias name created in count() concatenates the full table
name with a dot character. The alias now uses the table name without a schema prefix
and sanitized of quotations if present.
@bog-walk bog-walk requested review from e5l and joc-a February 26, 2024 01:42
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@bog-walk bog-walk merged commit 5f20eb8 into main Feb 26, 2024
5 checks passed
@bog-walk bog-walk deleted the bog-walk/fix-count-alias branch February 26, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants