fix print remote sql info coredump

This commit is contained in:
leslieyuchen
2022-03-15 12:02:28 +08:00
committed by LINxiansheng
parent 58698cf43a
commit a4d3ae7db7
5 changed files with 33 additions and 10 deletions

View File

@ -3066,6 +3066,7 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx, ObSQLSessionInfo &session, ObP
pctx->get_remote_sql_info().use_ps_ = true;
pctx->get_remote_sql_info().remote_sql_ = pc_ctx.sql_ctx_.cur_sql_;
pctx->get_remote_sql_info().ps_params_ = &param_store;
pctx->get_remote_sql_info().ps_param_cnt_ = static_cast<int32_t>(param_store.count());
} else if (phy_plan->temp_sql_can_prepare() && pc_ctx.neg_param_index_.is_empty() &&
!pc_ctx.sql_ctx_.multi_stmt_item_.is_batched_multi_stmt()) {
LOG_DEBUG("after get plan",
@ -3079,6 +3080,7 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx, ObSQLSessionInfo &session, ObP
pctx->get_remote_sql_info().use_ps_ = true;
pctx->get_remote_sql_info().remote_sql_ = phy_plan->get_constructed_sql();
pctx->get_remote_sql_info().ps_params_ = &param_store;
pctx->get_remote_sql_info().ps_param_cnt_ = static_cast<int32_t>(param_store.count());
} else {
param_store.reset();
pctx->get_remote_sql_info().use_ps_ = false;