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

Bring latest test fixes to 3.0 #365

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OPTION (WITH_SYSTEM_ABSEIL "Use system ABSEIL" OFF)
OPTION (WITH_SYSTEM_LZ4 "Use system LZ4" OFF)
OPTION (WITH_SYSTEM_CITYHASH "Use system cityhash" OFF)
OPTION (DEBUG_DEPENDENCIES "Print debug info about dependencies duting build" ON)
OPTION (CHECK_VERSION "Check that version number corresponds to git tag, usefull in CI/CD to validate that new version published on GitHub has same version in sources" ON)
OPTION (CHECK_VERSION "Check that version number corresponds to git tag, usefull in CI/CD to validate that new version published on GitHub has same version in sources" OFF)

PROJECT (CLICKHOUSE-CLIENT
VERSION "${CLICKHOUSE_CPP_VERSION}"
Expand Down
26 changes: 21 additions & 5 deletions clickhouse/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,30 @@ struct ClientInfo {
uint32_t client_revision = 0;
};

std::ostream& operator<<(std::ostream& os, const Endpoint& endpoint) {
return os << endpoint.host << ":" << endpoint.port;
}

std::ostream& operator<<(std::ostream& os, const ClientOptions& opt) {
os << "Client(" << opt.user << '@' << opt.host << ":" << opt.port
<< "Endpoints :";
for (size_t i = 0; i < opt.endpoints.size(); i++)
os << opt.user << '@' << opt.endpoints[i].host << ":" << opt.endpoints[i].port
os << "Client("
<< " Endpoints : [";
size_t extra_endpoints = 0;

if (!opt.host.empty()) {
extra_endpoints = 1;
os << opt.user << '@' << Endpoint{opt.host, opt.port};

if (opt.endpoints.size())
os << ", ";
}

for (size_t i = 0; i < opt.endpoints.size(); i++) {
os << opt.user << '@' << opt.endpoints[i]
<< ((i == opt.endpoints.size() - 1) ? "" : ", ");
}

os << " ping_before_query:" << opt.ping_before_query
os << "] (" << opt.endpoints.size() + extra_endpoints << " items )"
<< " ping_before_query:" << opt.ping_before_query
<< " send_retries:" << opt.send_retries
<< " retry_timeout:" << opt.retry_timeout.count()
<< " compression_method:"
Expand Down
1 change: 1 addition & 0 deletions clickhouse/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct ClientOptions {
};

std::ostream& operator<<(std::ostream& os, const ClientOptions& options);
std::ostream& operator<<(std::ostream& os, const Endpoint& options);

class SocketFactory;

Expand Down
Loading
Loading