Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ TEST(BinaryArrayAccessor, Test_CDataType_BINARY_Truncation) {
// It's safe to create a std::string from this data because we know it's
// ASCII, this doesn't work with arbitrary binary data.
ss << std::string(buffer.data(), buffer.data() + chunk_length);
} while (value_offset < values[0].length() && value_offset != -1);
} while (value_offset < static_cast<int64_t>(values[0].length()) && value_offset != -1);

ASSERT_EQ(values[0], ss.str());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TEST(StringArrayAccessor, Test_CDataType_CHAR_Truncation) {
ASSERT_EQ(values[0].length() - original_value_offset, strlen_buffer[0]);

ss << buffer.data();
} while (value_offset < values[0].length() && value_offset != -1);
} while (value_offset < static_cast<int64_t>(values[0].length()) && value_offset != -1);

ASSERT_EQ(values[0], ss.str());
}
Expand Down Expand Up @@ -154,7 +154,8 @@ TEST(StringArrayAccessor, Test_CDataType_WCHAR_Truncation) {
length = buffer.size();
}
finalStr.insert(finalStr.end(), buffer.data(), buffer.data() + length);
} while (value_offset < values[0].length() * GetSqlWCharSize() && value_offset != -1);
} while (value_offset < static_cast<int64_t>(values[0].length() * GetSqlWCharSize()) &&
value_offset != -1);

// Trim final null bytes
finalStr.resize(values[0].length() * GetSqlWCharSize());
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/flight/sql/odbc/flight_sql/address_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bool AddressInfo::GetAddressInfo(const std::string& host, char* host_name_info,
}

error = getnameinfo(addrinfo_result_->ai_addr, addrinfo_result_->ai_addrlen,
host_name_info, max_host, NULL, 0, 0);
host_name_info, static_cast<DWORD>(max_host), NULL, 0, 0);
return error == 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ TEST(ConvertToJson, Int16) {

TEST(ConvertToJson, Int32) {
ASSERT_EQ("2147483647", ConvertToJson(arrow::Int32Scalar(2147483647)));
ASSERT_EQ("-2147483648", ConvertToJson(arrow::Int32Scalar(-2147483648)));
// 2147483648 is not valid as a signed int, using workaround
ASSERT_EQ("-2147483648",
ConvertToJson(arrow::Int32Scalar(static_cast<int32_t>(-2147483647 - 1))));
}

TEST(ConvertToJson, Int64) {
ASSERT_EQ("9223372036854775807",
ConvertToJson(arrow::Int64Scalar(9223372036854775807LL)));
ASSERT_EQ("-9223372036854775808",
ConvertToJson(arrow::Int64Scalar(-9223372036854775808ULL)));
// 9223372036854775808ULL is not valid as a signed int64, using workaround
ASSERT_EQ("-9223372036854775808", ConvertToJson(arrow::Int64Scalar(static_cast<int64_t>(
-9223372036854775807LL - 1))));
}

TEST(ConvertToJson, UInt8) {
Expand Down