Skip to content

Db2 oracle: FETCH BEFORE | AFTER of a SCROLL cursor, proven on scrolldemo (Part of #4269) - #7160

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/4269-20261030T1541Z
Oct 30, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/4269-20261030T1541Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Part of #4269, slice 2 (follows #7148). The Db2 oracle now runs EXEC SQL FETCH [INSENSITIVE] BEFORE | AFTER [FROM] cursor of a SCROLL cursor, so the det port's positionScroll is proven against Db2 instead of only modelled.

  • equivalence_sql.py: the no-INTO BEFORE / AFTER form becomes a scroll FETCH statement with no host variable; a cursor not declared SCROLL is refused by name.
  • ggsql.c: BEFORE = CLI SQLFetchScroll(ABSOLUTE 0); AFTER = LAST then NEXT; SQLCODE 0, host variable untouched (the CLI's SQL_NO_DATA is the parked position, not +100).
  • SCRDEMO.cbl (scrolldemo): BEFORE, AFTER, the FROM / INSENSITIVE spellings, NEXT / PRIOR from each end, and an empty cursor.
  • test_sql_dynamic.py: hand trace extended; port counts (22 fetchScroll, 6 positionScroll); a unit test of the oracle table and the SCROLL refusal.
  • register/Q4.md: BEFORE/AFTER moved from "not yet proven" to proven on Db2.

Evidence level

Executed-equivalent on real Db2 (local Docker container) and GnuCOBOL: EQUIVALENCE_E2E=1 pytest test_sql_dynamic.py -k scrolldemo passed (proven: true, stdout equal to the hand trace). Oracle is GnuCOBOL plus Db2 LUW, not z/OS. Residual: an empty cursor's BEFORE/AFTER answers SQLCODE 0 on both sides (observed), not read from the z/OS book.

Gates

pr_gates --fast 9/9, --ratchets 9 pass / 0 skipped, test_sql_dynamic.py + test_equivalence_sql.py 157 passed / 4 skipped (the other Docker E2E ones), pinned ruff format clean. No translator or engine change; no golden bless.

Class / Sibling gaps

Class: scroll-cursor FETCH forms that only move the position and read no row; BEFORE and AFTER are the only members, now handled on both the port and the oracle. Sibling gaps, each still refused by name and used by no burned-estate program: FETCH ROWSET STARTING AT or an orientation; INSERT NOT ATOMIC CONTINUE ON SQLEXCEPTION; ATOMIC undo on a mid-rowset failure; SENSITIVE and DYNAMIC scroll cursors; scroll cursors WITH HOLD across COMMIT.

Remaining slices

Checklist items 3-5 on #4269 look landed but unticked; not edited here. The sibling gaps above.

Cross-repo

None: no companion PR in another repo. Overlaps open #7157 on Q4.md and test_sql_dynamic.py (small, disjoint hunks); whichever merges second merges main.

🤖 Generated with Claude Code

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 30, 2026 15:56
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 30, 2026 16:12
@squid-shepherd
squid-shepherd Bot merged commit 6008e20 into main Oct 30, 2026
68 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/4269-20261030T1541Z branch October 30, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant