GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Send GO batch text verbatim, like sqlcmd; release 0.1.17 by jwcraig · Pull Request #2 · jwcraig/sql-server-cli

Conversation

@jwcraig

@jwcraig jwcraig commented Oct 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

Why

A check of 0.1.16 ran a real deployment script through sscli and through sqlcmd -b, each on a fresh copy of the same database. Both runs succeeded, but the stored trigger definitions had different SHA-256 hashes.

The cause is in the GO splitter: it trimmed each batch and re-joined its lines with LF. The server stores a module's batch text as its definition, so sscli dropped trailing blank lines, leading whitespace and CR line endings that sqlcmd keeps. Such scripts need the module body byte for byte.

A script saved with a UTF-8 byte order mark also failed with "Incorrect syntax near ''".

What

  • Each batch is now an exact slice of the script. Whitespace-only batches are still skipped.
  • A leading byte order mark (BOM) is skipped.
  • Unit tests now expect verbatim text.
  • A new DB test checks that a temp procedure's stored definition equals its batch text byte for byte (CRLF, a BOM, and leading and trailing blank lines).
  • The README is updated, and the version is bumped to 0.1.17.

Verification

  • cargo fmt --check, clippy -D warnings and cargo test all pass.
  • The opt-in DB tests pass: 4 of 4 against a local scratch DB.
  • On LF and CRLF scripts, the stored procedure definition hash now matches sqlcmd -b exactly; with 0.1.16 the CRLF case differed. The BOM script now runs, where 0.1.16 failed on it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jc-systemslogiq added 2 commits October 9, 2026 17:40
@jc-systemslogiq
fix(sql): send GO batch text verbatim, like sqlcmd
2dd1473
Batches were trimmed and their lines re-joined with LF, so a module created
by a script (CREATE TRIGGER, CREATE PROCEDURE) stored a different definition
than sqlcmd stores: trailing blank lines, leading whitespace and CR line
endings were lost. A script saved with a UTF-8 byte order mark also failed
with a syntax error. Batches are now exact slices of the script, and a
leading byte order mark is skipped.
@jc-systemslogiq
chore(release): bump version to 0.1.17
1b45804
@jwcraig
jwcraig merged commit c6583c1 into main Oct 9, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@jwcraig
jwcraig deleted the fix/verbatim-batch-text branch October 9, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jwcraig @jc-systemslogiq
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.