Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-3018: Don't return NULL on zero length allocations.
......................................................................


IMPALA-3018: Don't return NULL on zero length allocations.

FunctionContext::Allocate() and FunctionContext::AllocateLocal()
used to return NULL for zero length allocations. This makes
it hard to distinguish between allocation failures and zero
length allocations. Such confusion may lead to DCHECK failure
in the macro RETURN_IF_NULL() in debug builds or access to NULL
pointers in non-debug builds.

This change fixes the problem above by returning NULL only if
there is allocation failure. Zero-length allocations will always
return a dummy non-NULL pointer.

Change-Id: Id8c3211f4d9417f44b8018ccc58ae182682693da
Reviewed-on: http://gerrit.cloudera.org:8080/3601
Reviewed-by: Michael Ho <[email protected]>
Tested-by: Internal Jenkins
---
M be/src/exprs/aggregate-functions-ir.cc
M be/src/runtime/free-pool.h
M be/src/udf/udf-test.cc
M be/src/udf/udf.cc
M testdata/workloads/functional-query/queries/QueryTest/aggregation.test
5 files changed, 28 insertions(+), 12 deletions(-)

Approvals:
  Michael Ho: Looks good to me, approved
  Internal Jenkins: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8c3211f4d9417f44b8018ccc58ae182682693da
Gerrit-PatchSet: 3
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Michael Ho <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: Sailesh Mukil <[email protected]>

Reply via email to