fix the error code of alloc mem failed
This commit is contained in:
		| @ -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_); | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 qingzhu521
					qingzhu521