fix the error code of alloc mem failed

This commit is contained in:
qingzhu521
2024-04-11 13:15:14 +00:00
committed by ob-robot
parent 41b19ba941
commit 76cb9ba4a4
2 changed files with 8 additions and 2 deletions

View File

@ -712,7 +712,10 @@ int ObTempExpr::deep_copy(ObIAllocator &allocator, ObTempExpr *&dst) const
{
int ret = OB_SUCCESS;
char *buf = static_cast<char *>(allocator.alloc(sizeof(ObTempExpr)));
CK(OB_NOT_NULL(buf));
if (OB_ISNULL(buf)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("fail to alloc mem in temp expr deep copy", K(ret));
}
OX(dst = new(buf)ObTempExpr(allocator));
OZ(dst->assign(*this, allocator));
OX(dst->expr_idx_ = expr_idx_);

View File

@ -343,7 +343,10 @@ int ObExecContext::build_temp_expr_ctx(const ObTempExpr &temp_expr, ObTempExprCt
char **frames = NULL;
char *mem = static_cast<char*>(get_allocator().alloc(sizeof(ObTempExprCtx)));
ObArray<char *> tmp_param_frame_ptrs;
CK(OB_NOT_NULL(mem));
if (OB_ISNULL(mem)) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("no more memory to create temp expr ctx", K(ret));
}
OX(temp_expr_ctx = new(mem)ObTempExprCtx(*this));
OZ(temp_expr.alloc_frame(get_allocator(), tmp_param_frame_ptrs, frame_cnt, frames));
OX(temp_expr_ctx->frames_ = frames);