Skip to content

fix: make ClickHouseDataReader.IsClosed reflect disposal - #588

Open
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/reader-isclosed
Open

fix: make ClickHouseDataReader.IsClosed reflect disposal#588
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/reader-isclosed

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

ClickHouseDataReader.IsClosed always returned false, even after Close() or Dispose().

  • Fix: Track the closed state in Dispose(bool).
  • Test: Add a regression test for Close().
  • Changelog: Add a bug-fix fragment.

Checklist

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG

Copilot AI lite review requested due to automatic review settings August 25, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes ADO.NET reader lifecycle reporting by making ClickHouseDataReader.IsClosed accurately reflect disposal/closure, aligning behavior with expected DbDataReader semantics and preventing misleading state checks by consumers.

Changes:

  • Track closed state via a new isClosed field and set it during Dispose(bool).
  • Update IsClosed to return the tracked closed state.
  • Add a regression test asserting IsClosed becomes true after calling Close(), plus a changelog fragment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ClickHouse.Driver/ADO/Readers/ClickHouseDataReader.cs Adds isClosed tracking and returns it from IsClosed, set during disposal so Close() (which calls Dispose()) is reflected.
ClickHouse.Driver.Tests/ADO/DataReaderTests.cs Adds regression coverage to ensure IsClosed flips to true after Close().
changelog.d/fix-reader-isclosed.fixes.md Documents the user-visible bug fix in a changelog fragment.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants