Skip to content

client: pass full Query to SendQuery in BeginInsert (preserve query_id)#517

Merged
slabko merged 1 commit into
ClickHouse:masterfrom
iliaal:begininsert-queryid
Jun 12, 2026
Merged

client: pass full Query to SendQuery in BeginInsert (preserve query_id)#517
slabko merged 1 commit into
ClickHouse:masterfrom
iliaal:begininsert-queryid

Conversation

@iliaal

@iliaal iliaal commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

BeginInsert(Query query) was calling SendQuery(query.GetText()).

The implicit Query(string) constructor uses an empty default query id, so any query_id the caller supplied was silently dropped. The INSERT would land in system.query_log with an auto-generated id.

Pass the full Query object (the one-shot Insert path already did this).

This was originally carried as a local patch and is exercised by real usage that cares about stable query ids for auditing.

@iliaal iliaal requested review from mzitnik and slabko as code owners June 10, 2026 20:31
BeginInsert(Query) was calling SendQuery(query.GetText()).

This dropped any caller-supplied query_id (the string constructor has empty default).

Pass the Query object directly so the id (and settings etc.) are preserved on the wire.

The one-shot Insert path already did the right thing.
@iliaal iliaal force-pushed the begininsert-queryid branch from 65f0776 to 52bd2c9 Compare June 10, 2026 20:32

@slabko slabko 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.

@iliaal, this is indeed a bug, thank you for caching it!

@slabko slabko merged commit 597ee82 into ClickHouse:master Jun 12, 2026
27 checks passed
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