to issue<49576316>:fix core when package complex variable as udf out param

This commit is contained in:
hanr881
2023-05-12 06:41:11 +00:00
committed by ob-robot
parent 17114b6933
commit bddcfc3d68
2 changed files with 36 additions and 16 deletions

View File

@ -355,8 +355,20 @@ int ObExprUDF::process_out_params(const ObObj *objs_stack,
result));
OX (result.copy_value_or_obj(*obj, true));
OX (result.set_param_meta());
} else {
// do nothing ...
} else if (params_desc.at(i).is_obj_access_out() &&
OB_INVALID_ID != params_desc.at(i).get_package_id() &&
OB_INVALID_ID != params_desc.at(i).get_index()) {
ObIAllocator *pkg_allocator = NULL;
pl::ObPLExecCtx plctx(nullptr, &exec_ctx, nullptr,nullptr,nullptr,nullptr);
ObObj &obj = iparams.at(i);
OZ (ObSPIService::spi_get_package_allocator(&plctx, params_desc.at(i).get_package_id(), pkg_allocator));
if (OB_SUCC(ret) && nullptr != pkg_allocator) {
if (obj.is_ext() && obj.get_meta().get_extend_type() != pl::PL_REF_CURSOR_TYPE) {
OZ (pl::ObUserDefinedType::deep_copy_obj(*pkg_allocator, obj, obj, true));
} else {
OZ (deep_copy_obj(*pkg_allocator, obj, obj));
}
}
}
}
return ret;