From c3495e035255d8d152cea9e13f75ab702c179316 Mon Sep 17 00:00:00 2001 From: 0xacc Date: Sat, 10 Feb 2024 06:36:54 +0000 Subject: [PATCH] [to #54806294] fix: fix anonymous block wrapper memory leak in MySQL mode --- src/pl/ob_pl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pl/ob_pl.cpp b/src/pl/ob_pl.cpp index cea82c8bb..af9aef458 100644 --- a/src/pl/ob_pl.cpp +++ b/src/pl/ob_pl.cpp @@ -1710,7 +1710,11 @@ int ObPL::execute(ObExecContext &ctx, ParamStore ¶ms, const ObStmtNodeTree * lib::ContextParam param; ObPLFunction *routine = NULL; ObCacheObjGuard cacheobj_guard(PL_ANON_HANDLE); - bool is_forbid_anony_parameter = block->is_forbid_anony_parameter_ || (params.count() > 0); + bool is_forbid_anony_parameter = + block->is_forbid_anony_parameter_ + || (params.count() > 0) + || lib::is_mysql_mode(); + int64_t old_worker_timeout_ts = 0; /* !!! * PL,req_timeinfo_guard一定要在执行前定义 @@ -1744,7 +1748,7 @@ int ObPL::execute(ObExecContext &ctx, ParamStore ¶ms, const ObStmtNodeTree * } if (OB_FAIL(ret)) { - } else if (!is_forbid_anony_parameter && lib::is_oracle_mode()) { + } else if (!is_forbid_anony_parameter) { OZ (parameter_anonymous_block(ctx, block, exec_params, ctx.get_allocator(), cacheobj_guard)); OX (routine = static_cast(cacheobj_guard.get_cache_obj())); CK (OB_NOT_NULL(routine));