Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query::fetch_one() and Query::fetch_optional() can still finish successfully even in the case of schema mismatch #187

Open
slvrtrn opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@slvrtrn
Copy link
Contributor

slvrtrn commented Dec 10, 2024

From the #186 (comment):

Query::fetch_one() and Query::fetch_optional() can still finish successfully even in the case of schema mismatch, because they don't read the whole response. This is a trade-off made ages ago to avoid parsing unused bytes.

Should we also revise that behavior? By the way, if the server returns a lot of rows (or large ones), it's possible to get EPIPE errors on the server side (because not all bytes are delivered).

We have several options here:

  • Parse all rows (better to detect the schema mismatch) and discard all besides the first one.
  • Don't parse them, but read the whole stream (to avoid EPIPE on the CH side).
  • Wait for Native/RowBinaryWithNAT for reliable error-detection.
@slvrtrn slvrtrn added the bug Something isn't working label Dec 10, 2024
@loyd
Copy link
Collaborator

loyd commented Dec 16, 2024

The same question applies to cursors that are not fully drained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants