Impala Public Jenkins has submitted this change and it was merged. ( 
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
Reviewed-on: http://gerrit.cloudera.org:8080/20579
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
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(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
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: merged
Gerrit-Change-Id: I0888f89070a1efeb9efefd1c3ca96dfa873942fd
Gerrit-Change-Number: 20579
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Becker <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to