Repository navigation
Conversation
Stmt.write's re-execute path wrote the cursor id, iteration count, execute options and flags with PutUint(x, 2, true, true). A compressed integer is a length byte followed by that many bytes, but PutUint caps the length byte at size while still writing every significant byte, so 65,536 is sent as 02 01 00 00. The server reads a count of 256 and every following field one byte off. Oracle 23ai/26ai reject it with ORA-03106; the same happens for an exeOf with 0x40000 set. Repro: prepare an array-bound INSERT, execute it twice with 65,536 rows. The first execute (parse) is fine, the second fails with ORA-03106; 65,535 rows work. With this change both executes load all rows (Oracle 26ai, FREEPDB1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #787.
Stmt.write's re-execute branch wrote the cursor id, iteration count, execute options and flags withPutUint(x, 2, true, true). For values over 0xFFFF,PutUintwrites a length byte of 2 followed by three bytes, which desynchronizes the message. On 23ai/26ai, executing an array DML of 65,536+ rows a second time fails with ORA-03106.These fields are UB4, so they are now written with size 4. Values ≤ 0xFFFF encode to exactly the same bytes as before (the compressed form only writes the significant bytes), so nothing changes on the wire for existing callers.
v2/command.go: size 4 for the four re-execute fields.v2/network/session_putuint_test.go: the compressed UB4 encodings, including 0x10000 and anexeOfvalue with 0x40000 set.Tested against Oracle Database 26ai Free: an array INSERT of 65,536 rows executed twice. Before: ORA-03106 on the second execute. After: 131,072 rows.