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

Short-circuit when insert values are empty #229

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Short-circuit when insert values are empty #229

merged 2 commits into from
Feb 19, 2024

Conversation

slvrtrn
Copy link
Contributor

@slvrtrn slvrtrn commented Feb 19, 2024

Summary

  • If InsertParams.values is an empty array, no request is sent to the server, and ClickHouseClient.insert short-circuits itself. In this scenario, the newly added InsertResult.executed flag will be false, and InsertResult.query_id will be an empty string.

  • Client no longer produces Code: 354. inflate failed: buffer error exception if request compression is enabled and InsertParams.values is an empty array (see above).

Checklist

Delete items not relevant to your PR:

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

@slvrtrn slvrtrn requested a review from mshustov February 19, 2024 15:21
@slvrtrn slvrtrn merged commit bd5bd29 into main Feb 19, 2024
23 checks passed
@slvrtrn slvrtrn deleted the empty-inserts branch February 19, 2024 16:08
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