Simplify parser test to pass raw query files to Parse#51
Merged
kyleconroy merged 2 commits intomainfrom Dec 26, 2025
Merged
Conversation
Collaborator
kyleconroy
commented
Dec 26, 2025
- Remove query preprocessing (comment stripping, line joining)
- Pass entire query file directly to parser.Parse()
- Parser handles comments via lexer
- Only check first statement's explain output
- Fix nil pointer dereferences in parseSelectWithUnion
- Add nil check in explainSelectWithUnionQuery
- Mark tests causing infinite loops as skip
- Skip parse_error tests when parser successfully parses
- Remove query preprocessing (comment stripping, line joining) - Pass entire query file directly to parser.Parse() - Parser handles comments via lexer - Only check first statement's explain output - Fix nil pointer dereferences in parseSelectWithUnion - Add nil check in explainSelectWithUnionQuery - Mark tests causing infinite loops as skip - Skip parse_error tests when parser successfully parses
The expression parser could enter an infinite loop when parsing tokens like EXCEPT, REPLACE, or LPAREN that have high precedence but only apply to specific left-hand expressions (like asterisks). Fix: Track parser position and break the loop if no tokens are consumed during infix parsing, preventing infinite loops when infix operators don't apply to the current expression. This re-enables 14 tests that were previously marked as skip due to causing infinite loops.
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.