Skip to content

det: a binary Db2 host variable takes what its bytes hold, -304 only beyond its width (#4579) - #4580

Merged
squid-protocol merged 3 commits into
mainfrom
fix/4579-detsql-comp-range
Oct 6, 2026
Merged

squid-protocol merged 3 commits into
mainfrom
fix/4579-detsql-comp-range

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4579

DetSql checked a numeric Db2 value against the host variable's PICTURE digits, so 2147483647 into S9(9) COMP gave -304. Now Cobol.storeHostChecked (used by DetSql.into) checks a binary item (COMP / COMP-4 / BINARY / COMP-5) against its 2/4/8-byte range regardless of TRUNC, as ggsql.c num_store does; the program's TRUNC is restored after. TRUNC(STD) still governs COBOL MOVE/arithmetic (C1). Documented as Q1a in oracle_assumptions.md.

Evidence: new test (halfword/fullword/doubleword boundaries, +/-, STD and BIN, COMP-5) fails without the fix; det_port run cbsa-updacc-generated, cbsa-updacc, cbsa-inqacc, cbsa-delacc all PROVED (Db2, EQUIVALENCE_E2E); cbsa-updacc-generated baseline line removed (#4577 merged); pr_gates --ratchets pass. Full suite: only test_tool_regex_redos timing flake on files this PR does not touch.

🤖 Generated with Claude Code

https://claude.ai/code/session_017BVJCCUMdjLJq1TAM3V34V

@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 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 6, 2026 18:21
@squid-protocol
squid-protocol merged commit f6c1c9a into main Oct 6, 2026
37 of 38 checks passed
@squid-protocol
squid-protocol deleted the fix/4579-detsql-comp-range branch October 6, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine legacy-modernization COBOL refractor, dead-code extraction, and JCL forging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DetSql: SELECT INTO a binary (COMP) host variable gives -304 for an INTEGER beyond the PICTURE's digits; Db2 assigns the fullword

1 participant