[CP] fix plan cache mismatch dur to return_rowid

This commit is contained in:
obdev
2023-07-05 11:12:17 +00:00
committed by ob-robot
parent 34bc7336c0
commit d65274e2c9
2 changed files with 9 additions and 1 deletions

View File

@ -138,6 +138,10 @@ int ObPlanSet::match_params_info(const ParamStore *params,
} }
} }
if (OB_SUCC(ret) && OB_NOT_NULL(pc_ctx.sql_ctx_.session_info_) && is_same) {
is_same = (is_cli_return_rowid_ == pc_ctx.sql_ctx_.session_info_->is_client_return_rowid());
}
//pre calculate //pre calculate
if (OB_SUCC(ret) && is_same) { if (OB_SUCC(ret) && is_same) {
ObPhysicalPlanCtx *plan_ctx = exec_ctx.get_physical_plan_ctx(); ObPhysicalPlanCtx *plan_ctx = exec_ctx.get_physical_plan_ctx();
@ -570,6 +574,7 @@ void ObPlanSet::reset()
related_user_var_names_.reset(); related_user_var_names_.reset();
related_user_sess_var_metas_.reset(); related_user_sess_var_metas_.reset();
is_cli_return_rowid_ = false;
all_possible_const_param_constraints_.reset(); all_possible_const_param_constraints_.reset();
all_plan_const_param_constraints_.reset(); all_plan_const_param_constraints_.reset();
all_equal_param_constraints_.reset(); all_equal_param_constraints_.reset();
@ -635,6 +640,7 @@ int ObPlanSet::init_new_set(const ObPlanCacheCtx &pc_ctx,
fetch_cur_time_ = plan.get_fetch_cur_time(); fetch_cur_time_ = plan.get_fetch_cur_time();
stmt_type_ = plan.get_stmt_type(); stmt_type_ = plan.get_stmt_type();
is_ignore_stmt_ = plan.is_ignore(); is_ignore_stmt_ = plan.is_ignore();
is_cli_return_rowid_ = session_info->is_client_return_rowid();
//add param info //add param info
params_info_.reset(); params_info_.reset();
// set variables for resource map rule // set variables for resource map rule

View File

@ -118,7 +118,8 @@ public:
multi_stmt_rowkey_pos_(alloc_), multi_stmt_rowkey_pos_(alloc_),
pre_cal_expr_handler_(NULL), pre_cal_expr_handler_(NULL),
res_map_rule_id_(common::OB_INVALID_ID), res_map_rule_id_(common::OB_INVALID_ID),
res_map_rule_param_idx_(common::OB_INVALID_INDEX) res_map_rule_param_idx_(common::OB_INVALID_INDEX),
is_cli_return_rowid_(false)
{} {}
virtual ~ObPlanSet(); virtual ~ObPlanSet();
@ -242,6 +243,7 @@ public:
//variables for resource map rule //variables for resource map rule
uint64_t res_map_rule_id_; uint64_t res_map_rule_id_;
int64_t res_map_rule_param_idx_; int64_t res_map_rule_param_idx_;
bool is_cli_return_rowid_;
}; };
class ObSqlPlanSet : public ObPlanSet class ObSqlPlanSet : public ObPlanSet