[CP] fix plan cache core at ref plan

This commit is contained in:
obdev 2023-09-14 12:40:27 +00:00 committed by ob-robot
parent 0285badc2e
commit 4ce5a32a29

View File

@ -63,13 +63,13 @@ deleting plan x |
void ObCacheObjAtomicOp::operator()(ObjKV &entry)
{
if (NULL != entry.second) {
if (0 == entry.second->get_ref_count()) {
// do nothing
} else {
int64_t ref_cnt = entry.second->inc_ref_count(ref_handle_);
if (ref_cnt > 1) {
cache_obj_ = entry.second;
cache_obj_->inc_ref_count(ref_handle_);
} else {
cache_obj_ = nullptr;
}
SQL_PC_LOG(DEBUG, "succ to get plan", "ref_count", cache_obj_->get_ref_count());
SQL_PC_LOG(DEBUG, "succ to get plan");
} else {
// do nothing
}