Skip to content

fix(client): quote table names in Insert queries - #573

Open
Tyagiquamar wants to merge 1 commit into
ClickHouse:masterfrom
Tyagiquamar:fix-insert-table-name-quoting-560
Open

Tyagiquamar wants to merge 1 commit into
ClickHouse:masterfrom
Tyagiquamar:fix-insert-table-name-quoting-560

Conversation

@Tyagiquamar

Copy link
Copy Markdown

Summary

  • Quote bare and qualified table identifiers in Client::Insert() via new TableNameToQueryString() helper
  • Pass through already backtick-quoted names and quote each part of database.table separately
  • Add integration test for inserting into a hyphenated table name without manual quoting

Fixes #560

Test plan

  • Docker clean build (ubuntu:24.04, clang-18, cmake -DBUILD_TESTS=ON, make -j1) — exit 0
  • Client/ClientCase.InsertQuotesBareTableName/* (2 cases, ClickHouse server on :9000) — PASSED

Client::Insert() now quotes bare and qualified table identifiers so
hyphenated or reserved names work without manual backticks.

Fixes ClickHouse#560
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.

Client::Insert concatenates the raw table name into SQL — table names needing backquotes cannot be used

1 participant