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: CASE-ELSE clause is not properly parsed when a value is constant #2238

Merged
merged 2 commits into from Apr 28, 2023
Merged

fix: CASE-ELSE clause is not properly parsed when a value is constant #2238

merged 2 commits into from Apr 28, 2023

Conversation

nozaq
Copy link
Contributor

@nozaq nozaq commented Apr 28, 2023

Fixes #2237

This PR contains the following changes.

  • Parse ELSE clause value as a constant instead of a type name when a node is ast.A_Const.
  • Add a test case for testing CASE expression with TEXT values.
  • Fix an error message when fails to parse the type name.

@nozaq nozaq changed the title Fix case else fix: CASE-ELSE clause is not properly parsed when a value is constant Apr 28, 2023
@kyleconroy kyleconroy merged commit 5555393 into sqlc-dev:main Apr 28, 2023
6 checks passed
@nozaq nozaq deleted the fix-case-else branch April 28, 2023 21:44
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.

Failed to parse CASE-ELSE clause with v1.18.0
2 participants