Skip to content

Keep update counts and rows from mixed SQL batches - #28

Closed
lovasoa wants to merge 1 commit into
mainfrom
review/mixed-results
Closed

lovasoa wants to merge 1 commit into
mainfrom
review/mixed-results

Conversation

@lovasoa

@lovasoa lovasoa commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

A caller that sends INSERT ...; SELECT ... as one SQL batch can miss the SELECT rows. A write between two row sets can also report zero affected rows.

This PR uses SQLMoreResults directly to return rows and affected-row counts in order. It also calls SQLMoreResults after ordinary single writes, where the current code stops at the row count. That overhead hasn't been measured.

If mixed batches are needed, port the patch to the current connection worker and verify that dropping a stream early still lets the caller reuse the cached statement. The current test covers a raw PostgreSQL batch only.

Refs #4.

Base automatically changed from review/validate-bind-count to main November 19, 2026 01:10
@lovasoa

lovasoa commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

The dropped result is real and reproduced on current main. Closing this patch because it takes over cursor cleanup from odbc-api, conflicts with the worker implementation, and adds result traversal to every single write without checking the cost or reuse after early stream drop. The reproduction and requirements for a replacement are recorded in #4.

@lovasoa lovasoa closed this Nov 27, 2026
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.

1 participant