Skip to content

Commit 5a1c573

Browse files
committed
Windows-specific fixes discovered by CI/CD
1 parent afdb9d2 commit 5a1c573

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

clickhouse/base/compressed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void CompressedOutput::Compress(const void * data, size_t len) {
142142
(const char*)data,
143143
(char*)compressed_buffer_.data() + HEADER_SIZE,
144144
len,
145-
compressed_buffer_.size() - HEADER_SIZE);
145+
static_cast<int>(compressed_buffer_.size() - HEADER_SIZE));
146146
if (compressed_size <= 0)
147147
throw std::runtime_error("Failed to compress chunk of " + std::to_string(len) + " bytes, "
148148
"LZ4 error: " + std::to_string(compressed_size));
@@ -164,7 +164,7 @@ void CompressedOutput::Compress(const void * data, size_t len) {
164164
}
165165

166166
void CompressedOutput::PreallocateCompressBuffer(size_t input_size) {
167-
const auto estimated_compressed_buffer_size = LZ4_compressBound(input_size);
167+
const auto estimated_compressed_buffer_size = LZ4_compressBound(static_cast<int>(input_size));
168168
if (estimated_compressed_buffer_size <= 0)
169169
throw std::runtime_error("Failed to estimate compressed buffer size, LZ4 error: " + std::to_string(estimated_compressed_buffer_size));
170170

clickhouse/client.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ void Client::Impl::ResetConnection() {
328328
socket = std::make_unique<Socket>(address);
329329

330330
if (options_.tcp_keepalive) {
331-
socket->SetTcpKeepAlive(options_.tcp_keepalive_idle.count(),
332-
options_.tcp_keepalive_intvl.count(),
333-
options_.tcp_keepalive_cnt);
331+
socket->SetTcpKeepAlive(
332+
static_cast<int>(options_.tcp_keepalive_idle.count()),
333+
static_cast<int>(options_.tcp_keepalive_intvl.count()),
334+
static_cast<int>(options_.tcp_keepalive_cnt));
334335
}
335336
if (options_.tcp_nodelay) {
336337
socket->SetTcpNoDelay(options_.tcp_nodelay);

clickhouse/columns/decimal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void ColumnDecimal::Append(const std::string& value) {
134134
bool sign = true;
135135
bool has_dot = false;
136136

137-
int zeros = 0;
137+
size_t zeros = 0;
138138

139139
while (c != end) {
140140
if (*c == '-') {

ut/readonly_client_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ void ReadonlyClientTest::TearDown() {
1818
client_.reset();
1919
}
2020

21+
// Sometimes gtest fails to detect that this test is instantiated elsewhere, suppress the error explicitly.
22+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ReadonlyClientTest);
2123
TEST_P(ReadonlyClientTest, Select) {
2224

2325
const auto & queries = std::get<1>(GetParam());

0 commit comments

Comments
 (0)