impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Hecht (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4436: StringValue::StringCompare() should match strncmp()
Date Tue, 15 Nov 2016 00:57:20 GMT
Dan Hecht has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/5083

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 will depends on the
mismatched position).

Fix StringCompare() to interpret as unsigned char.

Change-Id: Ic0750f98d8c5ef7d0c0ea279cd1f80b4acbad1be
---
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, 70 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/83/5083/1
-- 
To view, visit http://gerrit.cloudera.org:8080/5083
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0750f98d8c5ef7d0c0ea279cd1f80b4acbad1be
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Dan Hecht <dhecht@cloudera.com>

Mime
View raw message