Skip to content

equivalence: one SQL seed splitter for both sides (Fixes #4610) - #4646

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4610-seed-sql-comments
Oct 7, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4610-seed-sql-comments

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #4610 (part of #4270).

Cause

reset_script handed the seed text to three consumers verbatim: Db2's CLP (understands comments), ggsqlrun -f and the Java db2Reset (both split at ; outside ' and know nothing about --). An apostrophe in a -- comment flipped their quote state, so INSERTs after it were lost or merged, differently per side.

Fix

One splitter, equivalence_db2.split_sql / normalise_sql: single quotes ('' escapes), double-quoted identifiers, -- line comments, /* */ blocks. reset_script normalises every seed (file, JCL, symbols applied) through it, so all loaders get comment-free stmt;\n text. Unterminated quote/block comment, or a '/; inside a quoted identifier (which the loaders would misread), is refused by name.

Tests

tests/tools/test_equivalence_db2_seed.py (written failing first): a seed with -- it's, '--' and '/* */' inside literals, a block comment, '' escape; asserts splitter output and that the loaders' quote-toggle splitting of the normalised script equals it (while the raw seed does not); refusals.

Re-proofs

  • All 10 seed.sql files split identically to before (none contains a comment) => no seed rows change, no ledger/evidence refresh needed.
  • det_port.py run genapp-lgipdb01 (heavy-run.sh, Db2): PROVED.
  • pr_gates --fast: 5/5. --ratchets: only ports failed in my unprovisioned first run (timeout/env); ports_compile_check.py --cases carddemo-menu passes provisioned.
  • The apostrophe comment removed in the EIBTASKN branch never existed on main (git log -S empty), so nothing to restore here; the author can re-add it after this lands.
  • No oracle_assumptions.md entry: behaviour vs IBM unchanged.

🤖 Generated with Claude Code

split_sql/normalise_sql strip -- and /* */ comments outside literals and refuse unterminated quotes/blocks by name; reset_script runs every seed through it, so ggsqlrun -f and the Java db2Reset (both quote-toggle splitters) get identical statements.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 7, 2026 21:05
@squid-protocol
squid-protocol merged commit 1019310 into main Oct 7, 2026
26 checks passed
@squid-protocol
squid-protocol deleted the fix/4610-seed-sql-comments branch October 7, 2026 21:05
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.

equivalence Db2: a -- comment with an apostrophe in a case seed.sql is loaded differently by ggsqlrun, the Java reset and CLP

1 participant