Repository navigation
Conversation
cincuranet
left a comment
There was a problem hiding this comment.
For an explicit EXECUTE PROCEDURE command with 1CommandType.StoredProcedure, _command.Fetch()dequeues the output-parameter values into_peekedRow. If the caller checks HasRowsand then closes/disposes the reader without reading,ClosecallsSetOutputParameters`, but the statement’s queue is now empty. Output parameters remain unset; previously, closing the unread reader populated them.
b6075f1 to
ad32f38
Compare
HasRows fetches one row ahead. For a stored procedure that row is the output-parameter row, so closing the reader without calling Read left SetOutputParameters with an empty queue and the output parameters unset. Close and CloseAsync now pass the peeked row to SetOutputParameters. Also drop a duplicated HasRows assertion and document why _hasPeekedRow is kept. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
8cf4269 to
a31867d
Compare
|
@cincuranet Following up on the November 4 review. All identified issues have been addressed:
Both inline review threads are resolved. The current CI run passes 23/24 jobs. The only failure is Firebird 5 embedded, where the runner exits with code 3 during Could you rerun that job to establish whether the failure reproduces, and re-review the current patch? |
aa60fe8 to
02876ab
Compare
02876ab to
574d8c4
Compare
The embedded HasRows tests crash the Firebird 5.0.0 engine (the CI build, WI-V5.0.0.1306) on the second fetch after a HasRows peek. The crash does not occur on 5.0.4. - Download the official 5.0.4 Windows release for FB50 instead of the test-infrastructure archive. - Copy fbclient.dll to fbembed.dll when the release does not ship it; the embedded client loads fbembed.dll. - Fail the run when the started server reports a version below MinimumVersion (5.0.4 for FB50). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
…e archive The official Firebird 5.0.4 Windows release ships an uninitialized SECURITY5.FDB (no SYSDBA account, so every Default-server test fails with "Install incomplete") and a firebird.conf whose wire-crypt defaults reject the CryptDisabled and CryptRequired suites. Keep the official 5.0.4 binaries and overlay SECURITY5.FDB and firebird.conf from the test-infrastructure archive, which the suites were written against. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Fixes #1284.
Root cause
FbDataReader.HasRowsreturned_command.HasFields, which is true for any query with columns, including empty result sets.Change
HasRowsnow fetches one row ahead before the firstRead, andRead/ReadAsyncreturn that buffered row first. Empty, closed, schema-only, and fieldless results report false. The peek is synchronous becauseHasRowsis a synchronous property.Contract
DbDataReader.HasRows: "true if the DbDataReader contains one or more rows; otherwise false."
Tests
HasRowsIsFalseForAnEmptyResultTest: fails without the fix (Assert.IsFalse(reader.HasRows)fails on the upstream code).HasRowsDoesNotSkipTheFirstRowTest: guard for the peek logic. It also passes on the upstream code, because the oldHasRowswas true for that result.firebirdsql/firebird:5.0.2container): all runnable variants pass. Variants that need the embedded client or a wire-encryption mismatch could not run here.Verification gaps
AI disclosure
This change was prepared with AI assistance (Claude Code).
🤖 Generated with Claude Code