fix plan cache not sharing plan at weak read

This commit is contained in:
obdev
2023-07-25 08:48:25 +00:00
committed by ob-robot
parent 17a96954c7
commit ba97604527
3 changed files with 16 additions and 6 deletions

View File

@ -55,7 +55,8 @@ struct ObPlanCacheKey : public ObILibCacheKey
: key_id_(common::OB_INVALID_ID),
db_id_(common::OB_INVALID_ID),
sessid_(0),
mode_(PC_TEXT_MODE) {}
mode_(PC_TEXT_MODE),
is_weak_read_(false) {}
inline void reset()
{
@ -66,6 +67,7 @@ struct ObPlanCacheKey : public ObILibCacheKey
mode_ = PC_TEXT_MODE;
sys_vars_str_.reset();
config_str_.reset();
is_weak_read_ = false;
namespace_ = NS_INVALID;
}
@ -90,6 +92,7 @@ struct ObPlanCacheKey : public ObILibCacheKey
sessid_ = pc_key.sessid_;
mode_ = pc_key.mode_;
namespace_ = pc_key.namespace_;
is_weak_read_ = pc_key.is_weak_read_;
}
return ret;
}
@ -130,6 +133,7 @@ struct ObPlanCacheKey : public ObILibCacheKey
mode_ == pc_key.mode_ &&
sys_vars_str_ == pc_key.sys_vars_str_ &&
config_str_ == pc_key.config_str_ &&
is_weak_read_ == pc_key.is_weak_read_ &&
namespace_ == pc_key.namespace_;
return cmp_ret;
@ -141,6 +145,7 @@ struct ObPlanCacheKey : public ObILibCacheKey
K_(mode),
K_(sys_vars_str),
K_(config_str),
K_(is_weak_read),
K_(namespace));
//通过name来进行查找,一般是shared sql/procedure
//cursor用这种方式,对应的namespace是CRSR
@ -153,6 +158,7 @@ struct ObPlanCacheKey : public ObILibCacheKey
PlanCacheMode mode_;
common::ObString sys_vars_str_;
common::ObString config_str_;
bool is_weak_read_;
};
//记录快速化参数后不需要扣参数的原始字符串及相关信息