Repository navigation
equivalence: one SQL seed splitter for both sides (Fixes #4610) - #4646
Merged
Merged
Conversation
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]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4610 (part of #4270).
Cause
reset_scripthanded the seed text to three consumers verbatim: Db2's CLP (understands comments),ggsqlrun -fand the Javadb2Reset(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_scriptnormalises every seed (file, JCL, symbols applied) through it, so all loaders get comment-freestmt;\ntext. 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
seed.sqlfiles 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.portsfailed in my unprovisioned first run (timeout/env);ports_compile_check.py --cases carddemo-menupasses provisioned.git log -Sempty), so nothing to restore here; the author can re-add it after this lands.🤖 Generated with Claude Code