fix baseline key changed by get pl function
This commit is contained in:
@ -1563,6 +1563,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(),
|
||||
@ -1691,6 +1692,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_;
|
||||
|
||||
Reference in New Issue
Block a user