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

Deparser: Add parens around TypeCast in IndexElem #214

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

lfittl
Copy link
Member

@lfittl lfittl commented Oct 23, 2023

We were incorrectly omitting these parentheses, as well as missing a space outputting "CREATE INDEX ON t (col::typecastops_class)" instead of "CREATE INDEX ON t ((col::typecast) ops_class)".

Fixes #213

Copy link
Contributor

@msepga msepga left a comment

Choose a reason for hiding this comment

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

👍 Will rebase #225 such that eef3f76 is dropped in favor of this.

We were incorrectly omitting these parentheses, as well as missing a space
outputting "CREATE INDEX ON t (col::typecastops_class)" instead of
"CREATE INDEX ON t ((col::typecast) ops_class)".

Fixes #213
This is mainly in use for RangeFunction, but the logic in the grammar
here is more broad, allowing type casts to show up in places where
a function call would be expected. Fix by always using the "cast(..)"
syntax in such cases.
This covers the case where deparseFuncExprWindowless needs to handle
a TypeCast and output like a function call, since the other cast syntax
is not valid in FROM.
@lfittl lfittl force-pushed the deparser-fix-typecast-in-index-elem branch from 834000b to d1a2ffb Compare December 20, 2023 22:53
@lfittl lfittl merged commit df5f485 into 15-latest Dec 20, 2023
16 checks passed
@lfittl lfittl deleted the deparser-fix-typecast-in-index-elem branch January 1, 2024 20:01
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.

index conversion error
2 participants