Skip to content

Fix trailing MSSQL GO batch separators - #69

Open
dvasdekis wants to merge 1 commit into
pondpilot:masterfrom
dvasdekis:fix/issue-68-mssql-go-batches
Open

Fix trailing MSSQL GO batch separators#69
dvasdekis wants to merge 1 commit into
pondpilot:masterfrom
dvasdekis:fix/issue-68-mssql-go-batches

Conversation

@dvasdekis

Copy link
Copy Markdown

Summary

Fixes #68.

The existing MSSQL GO range splitter did not handle a separator line that extended beyond a semicolon-delimited range. A trailing GO could therefore remain as a standalone range and be sent to the SQL parser, producing PARSE_ERROR.

This change treats overlapping separator ranges as batch boundaries and clips them to the current statement range. It preserves the existing behavior for intermediate separators while removing trailing and repeated separators from analysis input.

Changes

  • Fix trailing and overlapping MSSQL GO range handling.
  • Add core regression coverage for:
    • trailing separators;
    • CRLF and case-insensitive separators;
    • repeated separators;
    • GO inside strings, comments, and bracket-quoted identifiers.
  • Add native WASM API tests for analyze_sql_json and split_statements_json.
  • Extend the real browser WASM integration harness with the MSSQL regression case.
  • Document the fix in the unreleased changelog.

Validation

Passed locally:

  • cargo fmt --all -- --check
  • cargo test -p flowscope-core mssql_ --locked
  • cargo test -p flowscope-wasm --test analysis --locked
  • cargo test --workspace --locked
  • cargo clippy --workspace --locked -- -D warnings
  • git diff --check

The browser integration test was not run in this environment because wasm-pack and Chromium are unavailable. It can be run locally with:

wasm-pack build crates/flowscope-wasm --target web --no-opt --out-dir packages/core/wasm
node ./scripts/test_wasm_browser.mjs

Or, if just is installed:

just test-wasm-browser

The regression input is:

SELECT 1;
GO
SELECT 2;
GO

Expected result: two analyzed statements and no PARSE_ERROR issues.

@dvasdekis
dvasdekis marked this pull request as ready for review September 1, 2026 04:49
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.

Release and verify MSSQL GO batch support in the published npm/WASM package

1 participant