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
2 changes: 1 addition & 1 deletion cpp/src/gandiva/precompiled/string_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ gdv_int32 ascii_utf8(const char* data, gdv_int32 data_len) {
if (data_len == 0) {
return 0;
}
return static_cast<gdv_int32>(data[0]);
return static_cast<gdv_int32>(static_cast<signed char>(data[0]));
}

// Returns the ASCII character having the binary equivalent to A.
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/gandiva/precompiled/string_ops_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ TEST(TestStringOps, TestAscii) {
EXPECT_EQ(ascii_utf8("", 0), 0);
EXPECT_EQ(ascii_utf8("123", 3), 49);
EXPECT_EQ(ascii_utf8("999", 3), 57);
EXPECT_EQ(ascii_utf8("\x80", 1), -128);
EXPECT_EQ(ascii_utf8("\xFF", 1), -1);
}

TEST(TestStringOps, TestChrBigInt) {
Expand Down