Repository navigation
Conversation
cincuranet
reviewed
Nov 4, 2026
cincuranet
left a comment
Member
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.
alaricd
force-pushed
the
fix/has-rows-contract
branch
from
November 4, 2026 13:50
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>
alaricd
force-pushed
the
fix/has-rows-contract
branch
from
November 5, 2026 12:44
8cf4269 to
a31867d
Compare
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 #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