to issue<52166867>:fix core when using object construct function if input argument is null

This commit is contained in:
hanr881
2023-09-13 07:40:11 +00:00
committed by ob-robot
parent 181b48beab
commit f2a538942f
2 changed files with 4 additions and 2 deletions

View File

@ -3336,11 +3336,12 @@ int ObPLExecState::init(const ParamStore *params, bool is_anonymous)
OZ(func_.get_frame_info().pre_alloc_exec_memory(*ctx_.exec_ctx_, ctx_.allocator_));
}
// init params may use exec stack, need append to pl context first
CK (OB_NOT_NULL(top_context_ = ctx_.exec_ctx_->get_my_session()->get_pl_context()));
OZ (top_context_->get_exec_stack().push_back(this));
OZ (init_params(params, is_anonymous));
CK (OB_NOT_NULL(top_context_ = ctx_.exec_ctx_->get_my_session()->get_pl_context()));
OZ (top_context_->get_exec_stack().push_back(this));
OX (top_context_->set_has_output_arguments(!func_.get_out_args().is_empty()));
if (OB_SUCC(ret)) {

View File

@ -138,6 +138,7 @@ int ObExprObjectConstruct::newx(ObEvalCtx &ctx, ObObj &result, uint64_t udt_id)
int64_t init_size = OB_INVALID_SIZE;
ObArenaAllocator tmp_alloc;
const pl::ObUserDefinedType *user_type = NULL;
CK (OB_NOT_NULL(ns));
OZ (ns->get_user_type(udt_id, user_type, &tmp_alloc));
CK (OB_NOT_NULL(user_type));
OZ (user_type->newx(alloc, ns, ptr));