提交 7d21e913 编写于 作者: O obdev 提交者: OB-robot

[CP] fix baseline key changed by get pl function

上级 c3d7ded2
......@@ -1564,6 +1564,7 @@ int ObPL::get_pl_function(ObExecContext &ctx,
OZ (ObPLContext::valid_execute_context(ctx));
if (OB_SUCC(ret)) {
ObPlanCache *plan_cache = ctx.get_my_session()->get_plan_cache();
ObPlanBaseKeyGuard guard(ctx.get_sql_ctx()->spm_ctx_.bl_key_);
ObPlanCacheCtx pc_ctx(sql,
true, // PS_MODE
ctx.get_allocator(),
......@@ -1692,6 +1693,7 @@ int ObPL::get_pl_function(ObExecContext &ctx,
} else { // standalone routine
static const ObString PLSQL = ObString("PL/SQL");
ObPlanCache *plan_cache = ctx.get_my_session()->get_plan_cache();
ObPlanBaseKeyGuard guard(ctx.get_sql_ctx()->spm_ctx_.bl_key_);
ObPlanCacheCtx pc_ctx(PLSQL,
false, // ps mode
ctx.get_allocator(),
......
......@@ -61,9 +61,9 @@ class ObResultSet;
class ObPlanBaseKeyGuard
{
public:
explicit ObPlanBaseKeyGuard(ObBaselineKey &bl_key)
: bl_key_(bl_key),
ori_bl_key_(bl_key) {}
[[nodiscard]] explicit ObPlanBaseKeyGuard(ObBaselineKey &bl_key)
: bl_key_(bl_key),
ori_bl_key_(bl_key) {}
~ObPlanBaseKeyGuard()
{
bl_key_ = ori_bl_key_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册