[CP] [CP] Fix binding outline cannot hit the plan cache

This commit is contained in:
obdev
2024-02-08 22:28:41 +00:00
committed by ob-robot
parent 216880d5e7
commit c0d5a64dc2

View File

@ -4338,6 +4338,8 @@ int ObSql::pc_add_plan(ObPlanCacheCtx &pc_ctx,
phy_plan->stat_.enable_udr_ = enable_udr;
if (PC_PS_MODE == pc_ctx.mode_ || PC_PL_MODE == pc_ctx.mode_) {
// pc_key_ may be modified elsewhere, so reset it before adding plan
pc_ctx.fp_result_.pc_key_.key_id_ = pc_ctx.sql_ctx_.statement_id_;
//远程SQL第二次进入plan,将raw_sql作为pc_key存入plan cache中,
//然后使用ps接口直接用参数化后的sql作为key来查plan cache,可以节省一次对SQL fast parse的代价
if (pc_ctx.sql_ctx_.is_remote_sql_) {