impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Internal Jenkins (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4436: StringValue::StringCompare() should match strncmp()
Date Tue, 15 Nov 2016 20:47:18 GMT
Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-4436: StringValue::StringCompare() should match strncmp()
......................................................................


IMPALA-4436: StringValue::StringCompare() should match strncmp()

According to the C standard, strncmp() interprets characters as
unsigned, whereas StringCompare() uses char (which happens to be
signed).  This means that for values greater than 127, they don't give
the same result (which is especially bad considering StringCompare()
falls back to strncmp(), and so the answer depends on the mismatched
position).

Fix StringCompare() to interpret as unsigned char.

Change-Id: Ic0750f98d8c5ef7d0c0ea279cd1f80b4acbad1be
Reviewed-on: http://gerrit.cloudera.org:8080/5083
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
---
M be/src/runtime/CMakeLists.txt
A be/src/runtime/string-compare-test.cc
M be/src/runtime/string-value.inline.h
3 files changed, 71 insertions(+), 1 deletion(-)

Approvals:
  Internal Jenkins: Verified
  Dan Hecht: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/5083
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0750f98d8c5ef7d0c0ea279cd1f80b4acbad1be
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Internal Jenkins

Mime
View raw message