Skip to content

Reset cursor result state before each query - #46

Merged
vgvoleg merged 1 commit into
mainfrom
codex/fix-cursor-result-reset
Sep 17, 2026
Merged

vgvoleg merged 1 commit into
mainfrom
codex/fix-cursor-result-reset

Conversation

@vgvoleg

@vgvoleg vgvoleg commented Sep 10, 2026

Copy link
Copy Markdown
Member

Fixes #45.

Reset buffered cursor rows, row count, and description whenever a new query
begins. This prevents unread rows from a previous operation from being
returned by a later execute call and keeps result metadata scoped to the
latest operation.

Add synchronous and asynchronous regression coverage for unread results,
consumed row counts, and statements without result columns.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues remain, and regression coverage is included.

Pull request overview

Resets cursor result state before each query to prevent stale rows and metadata from leaking between executions.

Changes:

  • Adds shared reset logic for synchronous and asynchronous cursors.
  • Adds regression tests for unread, consumed, and no-result queries.
File summaries
File Description
ydb_dbapi/cursors.py Resets buffered rows, row count, and description before queries.
tests/test_cursors.py Adds synchronous and asynchronous regression coverage.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@vgvoleg
vgvoleg merged commit 56a6d93 into main Sep 17, 2026
7 checks passed
@vgvoleg
vgvoleg deleted the codex/fix-cursor-result-reset branch September 17, 2026 10:09
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.

Cursor retains result state between execute calls

2 participants