Daniel Becker has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/20579


Change subject: IMPALA-12478: Invalid length in 
StringValue::LeastSmallerString()
......................................................................

IMPALA-12478: Invalid length in StringValue::LeastSmallerString()

Before this change, in StringValue::LeastSmallerString() we did not
check whether '*this' was an empty string and used 'len - 1' as the size
of a new std::string, which could lead to an exception. This change adds
a check for 'len == 0' and we return an empty string in that case.

Also, the function name should actually be LargestSmallerString(), as we
are interested in the largest string that is smaller than '*this', cf.
StringValue::LeastLargerString(). This patch renames the function.

Testing:
 - Expanded the relevant unit test in string-value-test.cc with the test
   of an empty string.

Change-Id: I0888f89070a1efeb9efefd1c3ca96dfa873942fd
---
M be/src/runtime/string-value-test.cc
M be/src/runtime/string-value.cc
M be/src/runtime/string-value.h
M be/src/util/min-max-filter-ir.cc
4 files changed, 17 insertions(+), 12 deletions(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0888f89070a1efeb9efefd1c3ca96dfa873942fd
Gerrit-Change-Number: 20579
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Becker <[email protected]>

Reply via email to