Skip to content

Ignore statements containing only semicolons or whitespace#501

Open
SAY-5 wants to merge 1 commit into
crate:mainfrom
SAY-5:fix-empty-statement-crash
Open

Ignore statements containing only semicolons or whitespace#501
SAY-5 wants to merge 1 commit into
crate:mainfrom
SAY-5:fix-empty-statement-crash

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Fixes #499.

Submitting a statement that contains only ; (or only whitespace/comments) crashed crash with IndexError: list index out of range from stmt_type(), since re.findall(r'[\w]+', ...) returns an empty list.

_process_sql now skips statements that have no word characters after stripping comments, so an empty line is written instead of crashing.

Added a regression test in MultipleStatementsTest.

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.

Crash crashes when handling a statement with semicolons only

1 participant