Repository navigation
Run a part of a set operation as a recordset whatever modifier it has, to close #3193 - #3209
Open
arsalankhan786777 wants to merge 1 commit into
Open
arsalankhan786777 wants to merge 1 commit into
arsalankhan786777 wants to merge 1 commit into
Conversation
SELECT VALUE, ROW, COLUMN, MATRIX, INDEX or TEXTSTRING in a later SELECT of UNION, UNION ALL, EXCEPT or INTERSECT threw a TypeError, because the part kept its modifier and returned no rows to copy. The part now always runs as a recordset. Fixes AlaSQL#3193 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.
SELECT a FROM A UNION ALL SELECT VALUE a FROM C(and ROW, COLUMN, MATRIX, INDEX, TEXTSTRING) threwTypeError: Cannot read properties of undefined (reading 'length'). A part of a set operation without a modifier is run as a recordset, but a part with its own modifier kept it, so it returned a bare value and the code that copies its rows readnd.data.lengthofundefined.as()insrc/select/queryfn.jsnow gives the run of every part the recordset modifier, as a set operation needs rows. The modifier is ignored there, as the issue suggests.Fixes #3193
Tested:
test/test3193.js(8 tests): UNION ALL with each of the six modifiers, the parenthesisedCOLUMN ... LIMIT 1form, and UNION, EXCEPT and INTERSECT with VALUE (compared with the same query without the modifier). The six UNION ALL modifier tests fail before the change; all 8 pass after. I did not check the UNION, EXCEPT and INTERSECT tests separately before the change.bun test --preload ./test/bun-setup.js ./test/test[0-9]*.js ./test/test-*.js: 9 failures (Excel 107-B, 2 CLI piped-input tests), the same 9 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