to issue<49916547>:fix sql in pl remote execute report 4007

This commit is contained in:
hanr881
2023-05-25 23:41:35 +00:00
committed by ob-robot
parent ceccbab67c
commit 0743b644cf
3 changed files with 9 additions and 1 deletions

View File

@ -2156,6 +2156,7 @@ int ObSql::handle_remote_query(const ObRemoteSqlInfo &remote_sql_info,
bool use_plan_cache = session->get_local_ob_enable_plan_cache();
context.self_add_plan_ = false;
PlanCacheMode mode = remote_sql_info.use_ps_ ? PC_PS_MODE : PC_TEXT_MODE;
mode = remote_sql_info.sql_from_pl_ ? PC_PL_MODE : mode;
context.cur_sql_ = trimed_stmt;
pc_ctx = new (pc_ctx) ObPlanCacheCtx(trimed_stmt,
mode,
@ -2237,6 +2238,7 @@ int ObSql::handle_remote_query(const ObRemoteSqlInfo &remote_sql_info,
remote_sql_info.ps_params_->pop_back();
}
PlanCacheMode mode = remote_sql_info.use_ps_ ? PC_PS_MODE : PC_TEXT_MODE;
mode = remote_sql_info.sql_from_pl_ ? PC_PL_MODE : mode;
if (OB_FAIL(handle_physical_plan(trimed_stmt, context, tmp_result, *pc_ctx, get_plan_err))) {
if (OB_ERR_PROXY_REROUTE == ret) {
LOG_DEBUG("fail to handle physical plan", K(ret));
@ -4317,6 +4319,7 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx,
if (OB_SUCC(ret) && phy_plan->is_remote_plan()
&& !phy_plan->contains_temp_table()
&& !enable_send_plan) {
pctx->get_remote_sql_info().sql_from_pl_ = PC_PL_MODE == pc_ctx.mode_;
//处理远程plan转发SQL的情况
ParamStore &param_store = pctx->get_param_store_for_update();
if (OB_NOT_NULL(ps_params)) {