Conversation
028fc69 to
ac76624
Compare
ac76624 to
7ce219d
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a new optional ClientName parameter that allows applications to identify themselves in the User-Agent header sent with requests to ClickHouse. The parameter acts as a prefix to the existing User-Agent string format.
- Introduces
ClientNameparameter in connection strings and DSN configuration - Updates User-Agent string construction to include the client name prefix
- Adds comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packaging/odbc.ini.sample |
Documents the new ClientName parameter and reorganizes configuration documentation |
driver/test/misc_it.cpp |
Adds test cases for ClientName parameter and User-Agent verification |
driver/test/error_handling_it.cpp |
Removes duplicate getQueryId method (moved to base class) |
driver/test/client_test_base.h |
Consolidates common test utilities including getQueryId method |
driver/platform/win/setup.cpp |
Updates Windows setup to handle ClientName configuration |
driver/connection.h |
Adds client_name field and removes unused useragent field |
driver/connection.cpp |
Implements ClientName parameter parsing and User-Agent string construction |
driver/config/ini_defines.h |
Defines ClientName configuration constants |
driver/config/config.h |
Updates ConnInfo structure with clientName field |
driver/config/config.cpp |
Adds ClientName to DSN parameter list |
README.md |
Documents the new ClientName parameter |
Comments suppressed due to low confidence (1)
packaging/odbc.ini.sample:1
- The word 'paramter' is misspelled. It should be 'parameter'.
# Insert the content of this file into ~/.odbc.ini or /etc/odbc.ini files.
| FAIL() << "Entry for query id " << query_id << " has not been found"; | ||
| } |
There was a problem hiding this comment.
The FAIL() statement is placed outside the while loop, which means it will always execute if the loop completes without finding the entry. This should be placed inside the loop or the loop should have a separate flag to track if the entry was found.
| FAIL() << "Entry for query id " << query_id << " has not been found"; | |
| } | |
| } | |
| FAIL() << "Entry for query id " << query_id << " has not been found"; |
There was a problem hiding this comment.
The loop has a retrun statement in the place where it finds the expected row and checks its content. The test must fail when the loop ends without returning somewhere in the middle of it.
This PR introduces an additional optional driver setting,
ClientName, which can be passed in the connection string. The value of this setting acts as a prefix for the User-Agent string that is sent with each request. The rest of the User-Agent string remains unchanged - it includes the name of the connector (clickhouse-odbc), the version, the platform, and so on.For example, the following connection string:
will produce the following User-Agent:
Fixes #459