Repository navigation
Do not use query.oldscope as a parameter name in CASE to close #3204 - #3208
Open
arsalankhan786777 wants to merge 1 commit into
Open
arsalankhan786777 wants to merge 1 commit into
arsalankhan786777 wants to merge 1 commit into
Conversation
…#3204 CASE in an argument of a table function in FROM or JOIN was compiled with query.oldscope as the name of a function parameter, which is a SyntaxError. Use a plain name when the context is not an identifier. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CASE in an argument of a table function in FROM or JOIN, such as
RANGE(1, CASE WHEN 1 = 1 THEN 3 ELSE 2 END), threwSyntaxError: Invalid destructuring assignment target. The argument is compiled withquery.oldscopeas the context, andCaseValue.toJSused that text as the name of a parameter of the function it writes.toJSnow uses a plain parameter name when the context is not an identifier. The code inside still reads the samequery.oldscope, so the result does not change.Fixes #3204
Tested:
test/test3204.js(4 tests: CASE WHEN, else branch, CASE expression WHEN in RANGE in FROM, and a table function in JOIN). It fails 4/4 on origin/main and passes 4/4 with the change.bun testrun oftest/test[0-9]*.jsandtest/test-*.jsafterbuild-only: 3057 pass, 9 fail. The 9 failures are in Test 107-B (Excel files) and Test CLI (piped input); I did not run them on origin/main, so I can not say they fail there too.prettieron the two changed files.Written with Claude Code (AI); tested locally with bun test (new test file and the full test suite) on Windows.
🤖 Generated with Claude Code