You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DetSql: SELECT INTO a binary (COMP) host variable gives -304 for an INTEGER beyond the PICTURE's digits; Db2 assigns the fullword #4579
era:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)scope:coreBlocks a burned-estate program's next evidence rung, or the 4th-estate one-shot trial
Found by #4507's generated Db2 rows (case cbsa-updacc-generated, PR #4577).
What. CBSA UPDACC selects ACCOUNT_OVERDRAFT_LIMIT INTEGER into HV-ACCOUNT-OVERDRAFT-LIM PIC S9(9) COMP. A generated row holds the INTEGER boundary 2147483647 (and -2147483648).
COBOL side (tests/equivalence/db2/ggsql.c, num_store): a binary host variable takes any value its 2/4/8 bytes hold -- -304 only beyond the halfword/fullword range. The row is assigned, the program goes on to UPDATE.
det port (gitgalaxy/tools/cobol_to_java/det/cobolrt/sql/DetSql.java, Cobol.storeChecked around line 293): the value is checked against the PICTURE's 9 digits, so 2147483647 is SQLCODE -304 / 22003; the det UPDACC reports "UPDACC returned -00000304 on SELECT" and skips the UPDATE.
Db2 for z/OS assigns an INTEGER to an S9(9) COMP host variable as a fullword (the precompiler declares S9(9) COMP as INTEGER), so the oracle's behaviour is the expected one; the hand-written cbsa-updacc port agrees with it.
Effect.det_port.py run cbsa-updacc-generated: DIFFERS on the tasks whose account row has an overdraft limit beyond 999999999 (3 of 40 scenarios, each in runTask and java-facade). Listed in tests/equivalence/det_sweep_baseline.json under this issue by #4577.
Fix. In DetSql, for a binary host variable check the value against the binary range of its length (as ggsql.c does), not the PICTURE's digits (with TRUNC(BIN) semantics as the rest of the det runtime models them).
era:2Era CICS/MVS-ESA, COBOL II/85: RESP, SQL, DPL (~1988-96) (era_tags.py)scope:coreBlocks a burned-estate program's next evidence rung, or the 4th-estate one-shot trial
Activity
WIP: Db2 evidence re-proven; det baseline for cbsa-updacc-generated (#…
Equivalence harness: Db2 rows generated from DDL, SQL outcomes and ta…
det: a binary Db2 host variable takes what its bytes hold, -304 only …