The GitHub Actions job "E2E - MCP" on shardingsphere.git/master has succeeded.
Run started by GitHub user terrymanu (triggered by terrymanu).

Head commit for run:
101c3d56ccd7ee3c4a390a8f37550bed58a4751c / rishi-rana <[email protected]>
Add error handling for unknown or closed BLOB handles and ids in Firebird Proxy 
(#39773)

* Add error handling for unknown or closed BLOB handles and ids in Firebird 
Proxy

Fixes 4 of 5 sub-cases in #39052 (isc_blobtoobig split off to #39772
pending a design decision on the buffered-size limit):

- FirebirdOpenBlobCommandExecutor: throw InvalidSegstrIdException on an
  unknown BLOB id instead of registering an empty BLOB.
- FirebirdPutBlobSegmentCommandExecutor / 
FirebirdBatchBlobSegmentsCommandExecutor:
  check appendSegment()'s OptionalInt result and throw
  InvalidSegstrHandleException on an unknown or already-closed handle
  instead of silently reporting success. Covers both the "unknown
  handle" and "put after close" cases, since closeWrite() removes the
  cache entry either way.
- FirebirdExecuteStatementCommandExecutor.bindBlobParameters(): throw
  InvalidSegstrIdException for an unknown or unclosed BLOB parameter
  instead of silently binding null.

Adds InvalidSegstrHandleException/InvalidSegstrIdException and their
FirebirdVendorError/FirebirdDialectExceptionMapper wiring, following
the error-handling pattern established in #38927 (gdscodes and SQL
states verified against the jaybird client jar: isc_bad_segstr_handle
and isc_bad_segstr_id both map to SQLSTATE 42000).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0126yyNgnn3J8br27eT4P5as

* Point release notes entry at the opened PR

* Address review findings on Firebird BLOB write handle validation

- Validate the BLOB handle before iterating segments in
  FirebirdBatchBlobSegmentsCommandExecutor, so an empty batch on an
  unknown or closed handle no longer returns a success response.
  Firebird validates the handle before entering the loop in
  rem_port::put_segment().
- Treat a zero BLOB id in FirebirdOpenBlobCommandExecutor as the NULL
  BLOB quad and open an empty BLOB instead of raising an invalid BLOB
  id, matching blb::open2(). This mirrors the existing zero-id handling
  in FirebirdExecuteStatementCommandExecutor.bindBlobParameters().
- Distinguish a handle opened for reading from an unknown handle in the
  new shared FirebirdBlobWriteHandleValidator, raising
  isc_cannot_update_old_blob instead of isc_bad_segstr_handle, matching
  BLB_put_segment().

The read-handle check uses FirebirdBlobHandleGenerator allocation state
rather than read-cache cursor presence, because
FirebirdBlobReadCache.readSegment() removes the cursor once a BLOB is
fully consumed; a drained but unclosed read handle would otherwise be
reported as unknown.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0126yyNgnn3J8br27eT4P5as

* Reject unknown result-BLOB ids in Firebird statement parameter binding

A negative BLOB id refers to a Proxy-generated result BLOB held by
FirebirdBlobBinaryProtocolValue. bindBlobParameters() bound the lookup
result without checking it, so a stale, cross-connection or fabricated
negative id reached backend execution as SQL NULL, which is the silent
behaviour #39052 requires to be an error.

Check the lookup before assigning the parameter and throw
InvalidSegstrIdException when no content exists. Valid result-BLOB reuse
is unaffected and stays covered by assertBindResultBlobParameter.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0126yyNgnn3J8br27eT4P5as

* Open a created and closed BLOB by its id in Firebird Proxy

A BLOB created by the client keeps its id and content in
FirebirdBlobWriteCache after close_blob, but open_blob only consulted the
result BLOB store, so create_blob -> put_segment -> close_blob ->
open_blob raised isc_bad_segstr_id for a known id instead of opening its
stored content. Firebird allows a created BLOB to be opened once closed.

Resolve the content by id: zero opens an empty BLOB, a negative id reads
the result BLOB store, and a positive id reads the write cache, which is
rejected when the id is unknown or still open.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0126yyNgnn3J8br27eT4P5as

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>

Report URL: https://github.com/apache/shardingsphere/actions/runs/35138114910

With regards,
GitHub Actions via GitBox

Reply via email to