Skip to content

mssql: pin CREATE OR ALTER PROCEDURE splitting after a statement without GO - #409

Merged
rebelice merged 1 commit into
mainfrom
claude/byt-10207-reproduction-425d75
Sep 10, 2026
Merged

mssql: pin CREATE OR ALTER PROCEDURE splitting after a statement without GO#409
rebelice merged 1 commit into
mainfrom
claude/byt-10207-reproduction-425d75

Conversation

@rebelice

Copy link
Copy Markdown
Collaborator

Regression test for BYT-10207.

A customer on Bytebase 3.14.0 hit Syntax error at line 98:20 from bytebase-action check on a migration whose CREATE OR ALTER PROCEDURE followed an ALTER TABLE with no GO between them. The legacy ANTLR splitter treated the ; terminators inside the procedure body as statement boundaries, cut the procedure into fragments, and each fragment then failed to parse standalone. The omni parser, shipped in 3.17.1, never had the defect, but nothing guarded the behaviour. The issue asked for a test to pin it.

The fixture mirrors the customer's file: an optional preceding statement with or without GO, Spanish accented comments, and a procedure body full of ;, padded so SET NOCOUNT ON; lands on line 98. For each of the three shapes the test asserts the exact statement sequence by AST type, that the procedure starts at its CREATE keyword, and that its Text runs unbroken from CREATE through the final END;.

Verified against bytebase origin/main (47a923697c) through base.ParseStatements as well: the no-GO shape yields two clean statements.

go vet ./mssql and go test ./mssql pass.

🤖 Generated with Claude Code

…out GO

Regression test for BYT-10207. A customer on Bytebase 3.14.0 got a
"Syntax error at line 98:20" from bytebase-action check on a migration
whose CREATE OR ALTER PROCEDURE followed an ALTER TABLE with no GO
between them. The legacy ANTLR splitter treated the ';' terminators
inside the procedure body as statement boundaries, cut the procedure
into fragments, and each fragment then failed to parse on its own. The
omni parser (shipped in 3.17.1) never had the defect, but nothing
guarded the behaviour.

The fixture mirrors the customer's file: an optional preceding
statement with or without GO, Spanish accented comments, and a
procedure body full of ';', padded so SET NOCOUNT ON; lands on line 98.
For each of the three shapes the test asserts the exact statement
sequence by AST type, that the procedure starts at its CREATE keyword,
and that its Text runs unbroken from CREATE through the final END;.

go vet ./mssql and go test ./mssql pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T06:57:47.631215Z ec07773 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@rebelice
rebelice merged commit 437acdf into main Sep 10, 2026
23 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