diff --git a/src/sql/engine/expr/ob_expr_frame_info.cpp b/src/sql/engine/expr/ob_expr_frame_info.cpp index 1e0fae94ca..ab35252944 100644 --- a/src/sql/engine/expr/ob_expr_frame_info.cpp +++ b/src/sql/engine/expr/ob_expr_frame_info.cpp @@ -712,7 +712,10 @@ int ObTempExpr::deep_copy(ObIAllocator &allocator, ObTempExpr *&dst) const { int ret = OB_SUCCESS; char *buf = static_cast(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_); diff --git a/src/sql/engine/ob_exec_context.cpp b/src/sql/engine/ob_exec_context.cpp index 329c5ca3f9..6f1132d2b4 100644 --- a/src/sql/engine/ob_exec_context.cpp +++ b/src/sql/engine/ob_exec_context.cpp @@ -343,7 +343,10 @@ int ObExecContext::build_temp_expr_ctx(const ObTempExpr &temp_expr, ObTempExprCt char **frames = NULL; char *mem = static_cast(get_allocator().alloc(sizeof(ObTempExprCtx))); ObArray 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);