Repository navigation
det SQL: FETCH BEFORE | AFTER of a SCROLL cursor parks the position, no row (Part of #4269) - #7148
Merged
Merged
Conversation
…no row (Part of #4269) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
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.
Summary
Part of #4269 (COBOL translator: embedded SQL breadth).
EXEC SQL FETCH [INSENSITIVE] BEFORE | AFTER [FROM] cursoron a SCROLL cursor was refused by name. The det port now models it:DetSql.positionScrollparks the cursor before its first row (POS 0) or after its last (POS n+1), SQLCODE 0, no host variable touched, no repository method (no row is read). A closed cursor gives -501/24501 as for the other FETCH forms.Still refused by name (register Q4): BEFORE/AFTER with an INTO, on a cursor not declared SCROLL, on a SENSITIVE or DYNAMIC cursor, or WITH HOLD.
Changes
det/sql.py:_fetch_positionemits the call;_refuse_scroll_and_rowsetswaps the blanket refusal for the narrower ones above.DetSql.java:positionScroll, ruleRT-SQL-SCROLL-POSITION(also incobolrt_rules.json).register/Q4.md: modelled in the port, not yet proven on Db2.test_sql_dynamic.py: JDK trace through BEFORE/AFTER, closed and empty cursors; codegen and refusal tests (batch and CICS).Evidence level
Translated and executed on the JDK against the port's own model only. Not executed-equivalent against Db2: the oracle (
ggsql.c,equivalence_sql.py) still refuses the statement, so nothing here is claimed as proven. The Db2 E2E tests (EQUIVALENCE_E2E=1) were skipped locally (no Docker).Gates
pr_gates --fast --ratchetsall pass,audit_check.pyclear, 266 tree-wide guard tests pass,test_sql_dynamic.py143 passed / 4 skipped (the Docker E2E ones).det_port.py check: 82 of 182 ports list as changed, every one for the same single file,cobolrt/sql/DetSql.java(+22 lines, the newpositionScrollmethod, which none of them calls). No translated output changed. I did not re-prove those 82 (Db2 ports need Docker, unavailable here); a reviewer who wants them re-proven runs thedet_port.py runlinecheckprints.Class / Sibling gaps
Class: scroll-cursor FETCH forms that only move the position and read no row. Done here: BEFORE, AFTER. Sibling gaps, each still refused by name: FETCH ROWSET with 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
ggsql.c(BEFORE = SQLFetchScroll ABSOLUTE 0, AFTER = LAST then NEXT), the no-INTO FETCH form inequivalence_sql.py, and both orientations added to the scrolldemo Db2 proof. Left out to stay within the 5 hand-written-file cap; Q4 says "not yet proven" until it lands.Cross-repo
None: no companion PR in another repo.
🤖 Generated with Claude Code