Repository navigation
det-port Db2: INSERT ... FOR n ROWS ATOMIC undo via an internal savepoint (Part of #4269) - #7189
Merged
Merged
Conversation
…oint (Part of #4269) A failing row now undoes the whole statement (SQLERRD(3) 0, that row's SQLCODE) on the unit of work, proven on Db2 by INSDEMO. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
…849Z # Conflicts: # docs/language_status/register/Q4.md
…ade its asserts unreachable, CodeQL py/unreachable-statement) (Part of #4269) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
No description provided. |
Contributor
|
No description provided. |
Contributor
|
No description provided. |
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.
Part of #4269.
What
INSERT ... VALUES (:A1, ...) FOR n ROWS(ATOMIC, the default) now undoes the whole statement when a row fails, as Db2 does: SQLERRD(3) is 0 and the SQLCODE is the failing row's. Before, a failure after the first row was refused at run time on both sides.The port sets an internal savepoint
GGINSROWS_UNDOon the unit of work's connection (DetSql.UnitOfWork.execute), rolls back to it and releases it on failure, and releases it on success. Without a unit of work the old refusal stays. The oracle (ggsql.c) runs the same savepoint statements and logs them after the caller's outcome, so the SQL log matches the Java JDBC log in order.Evidence
test_detsql_insert_rows_undoes_the_rows_before_a_failing_one_with_a_savepoint.pr_gates --fast9/9,--ratchets9 pass,audit_checkclear, guard tests 211 pass. No golden master is affected (no parser/regex change).Class / Sibling gaps
Checklist: partial [c:f7800395] -- INSERT FOR n ROWS undo done; scroll cursors (SENSITIVE/DYNAMIC, WITH HOLD) and rowset FETCH with STARTING AT, an orientation, or no FOR n ROWS remain
Checklist: partial [c:005d2c3c] -- the INSERT rowset is now a real unit of work with undo; CICS ROLLBACK stays refused with -926
Checklist: partial [c:022d6a2a] -- Q4 register updated for the INSERT FOR n ROWS form; other forms' Q4 entries unchanged
Sibling gaps (still refused):
INSERT ... NOT ATOMIC CONTINUE ON SQLEXCEPTION(needs per-row SQLCA arrays / GET DIAGNOSTICS); rowset FETCH withSTARTING AT, an orientation or noFOR n ROWS; SENSITIVE/DYNAMIC scroll cursors; scrollWITH HOLD; CICS ROLLBACK (-926); DESCRIBE, CONNECT and CALL; host-variable arrays outside these two forms.Remaining slices: NOT ATOMIC CONTINUE; rowset FETCH positioning; sensitive/dynamic and WITH HOLD scroll; CICS ROLLBACK.
Cross-repo: none. Overlaps open PR #7173 (Q4.md, doc-only; edit kept small) and #7178 (cics
ggcics*.c, not touched); origin/main merged cleanly.Lessons for agents
DetSql.failed()rethrows non-SQLException errors: a JDK test stub must throwIllegalStateException(new SQLException(msg, state, code)).🤖 Generated with Claude Code