Repository navigation
Run the table function of FROM with the query as this to close #3203 - #3207
Open
arsalankhan786777 wants to merge 1 commit into
Open
arsalankhan786777 wants to merge 1 commit into
arsalankhan786777 wants to merge 1 commit into
Conversation
…#3203 A subquery, IN or EXISTS in an argument of a table function in FROM (RANGE(1, (SELECT MAX(x) FROM u))) read this.queriesfn, but the function that reads the source ran with the source as this, so it threw a TypeError. Run it with the query as this, as WHERE and ON do. 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.
A subquery, IN or EXISTS in an argument of a table function in FROM, such as
RANGE(1, (SELECT MAX(x) FROM u)), threwTypeError: Cannot read properties of undefined (reading '0'). The code of the argument readsthis.queriesfn, but the function that reads the source ran with the source asthis, and a source has noqueriesfn.queryfn.jsnow callssource.datafnwith the query asthis, as WHERE and ON do. No source function usesthis, so nothing else changes.Fixes #3203
Tested:
test/test3203.js(6 tests): the three statements of the issue, a subquery in the first argument, in a subquery in FROM, and with a?parameter. All 6 fail before the change and pass after.bun test --preload ./test/bun-setup.js ./test/test[0-9]*.js ./test/test-*.js: 10 failures (Excel 107-B, test2979 D, two CLI piped-input tests), the same 10 on unchangedmain.prettier --list-differenton the two files: clean.Written with Claude Code (AI); tested locally with bun 1.4.2 (
bun teston the built dist) and prettier🤖 Generated with Claude Code