Skip to content

fix(guard): blank lines in a query are whitespace - #68

Merged
stbischof merged 1 commit into
mainfrom
fix/guard-blank-lines
Oct 16, 2026
Merged

stbischof merged 1 commit into
mainfrom
fix/guard-blank-lines

Conversation

@stbischof

Copy link
Copy Markdown
Contributor

JSqlParser reads two or more blank lines as the end of a statement, so select *\n\n\nfrom foo was refused as two statements.

  • Runs of blank lines outside literals and comments are collapsed before parsing; two statements separated only by blank lines still fail, blank lines inside a literal stay.
  • DeparserColumResolver.getResolvedStatementText(String) parses a script and refuses more than one statement instead of dropping the rest.
  • Stays on jsqlparser 5.4.15; split out of jsqlparser 5.4.162, guard reads blank lines as whitespace #66, which keeps only the version update.

JSqlParser ends a statement at two blank lines, so a formatted query failed
the guard. getResolvedStatementText(String) refuses more than one statement.

Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
@stbischof
stbischof merged commit 0049516 into main Oct 16, 2026
54 of 56 checks passed
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.

1 participant