[CP] [to #46475366] fix memory leak of udf`s collection result
This commit is contained in:
@ -514,10 +514,13 @@ int ObExprUDF::eval_udf(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &res)
|
|||||||
} else if (info->is_called_in_sql_) {
|
} else if (info->is_called_in_sql_) {
|
||||||
if (tmp_result.is_pl_extend()) {
|
if (tmp_result.is_pl_extend()) {
|
||||||
OZ (pl::ObUserDefinedType::deep_copy_obj(alloc, tmp_result, result, true));
|
OZ (pl::ObUserDefinedType::deep_copy_obj(alloc, tmp_result, result, true));
|
||||||
|
OZ (pl::ObUserDefinedType::destruct_obj(tmp_result, ctx.exec_ctx_.get_my_session()));
|
||||||
|
CK (OB_NOT_NULL(ctx.exec_ctx_.get_pl_ctx()));
|
||||||
|
OX (ctx.exec_ctx_.get_pl_ctx()->reset_obj());
|
||||||
|
OZ (ctx.exec_ctx_.get_pl_ctx()->add(result));
|
||||||
} else {
|
} else {
|
||||||
OZ (deep_copy_obj(alloc, tmp_result, result));
|
OZ (deep_copy_obj(alloc, tmp_result, result));
|
||||||
}
|
}
|
||||||
OX (ctx.exec_ctx_.get_pl_ctx()->reset_obj());
|
|
||||||
} else {
|
} else {
|
||||||
result = tmp_result;
|
result = tmp_result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user