[to #41932470] fix memory of udf

This commit is contained in:
obdev
2023-02-06 23:45:36 +08:00
committed by ob-robot
parent ec4fd2244f
commit 9b302b8660
11 changed files with 96 additions and 99 deletions

View File

@ -35,7 +35,7 @@ STATIC_ASSERT(sizeof(ObPrecision) == sizeof(ObLengthSemantics),
OB_SERIALIZE_MEMBER(ObDatumMeta, type_, cs_type_, scale_, precision_);
ObEvalCtx::ObEvalCtx(ObExecContext &exec_ctx)
ObEvalCtx::ObEvalCtx(ObExecContext &exec_ctx, ObIAllocator *allocator)
: frames_(exec_ctx.get_frames()),
max_batch_size_(0),
exec_ctx_(exec_ctx),
@ -44,7 +44,7 @@ ObEvalCtx::ObEvalCtx(ObExecContext &exec_ctx)
tmp_alloc_used_(exec_ctx.get_tmp_alloc_used()),
batch_idx_(0),
batch_size_(0),
expr_res_alloc_(exec_ctx.get_eval_res_allocator())
expr_res_alloc_((dynamic_cast<ObArenaAllocator*>(allocator) != NULL) ? (*(dynamic_cast<ObArenaAllocator*>(allocator))) : exec_ctx.get_eval_res_allocator())
{
}