[CP] fix dynamic memleak when executing select stmt containing udf

This commit is contained in:
obdev
2022-12-07 07:06:00 +00:00
committed by ob-robot
parent 7d793b8862
commit 7ccc8ed5d3
3 changed files with 9 additions and 7 deletions

View File

@ -480,13 +480,14 @@ int ObExprUDF::eval_udf(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res)
CK (0 < udf_params->count());
OZ (ns.init_complex_obj(alloc, pl_type, udf_params->at(0), false, false));
}
ObEvalCtx::TempAllocGuard tmp_alloc_g(ctx);
ObArenaAllocator allocator;
try {
int64_t package_id = info->is_udt_udf_ ?
share::schema::ObUDTObjectType::mask_object_id(info->udf_package_id_)
: info->udf_package_id_;
OZ(pl_engine->execute(ctx.exec_ctx_,
info->is_called_in_sql_ ? tmp_alloc_g.get_allocator()
info->is_called_in_sql_ ? allocator
: alloc,
package_id,
info->udf_id_,