Fix remote execution error 4016
This commit is contained in:
parent
196359d85f
commit
e01e420726
@ -35,6 +35,7 @@ DEF_TO_STRING(ObRemoteSqlInfo)
|
||||
J_OBJ_START();
|
||||
J_KV(K_(use_ps),
|
||||
K_(is_batched_stmt),
|
||||
K_(is_original_ps_mode),
|
||||
K_(ps_param_cnt),
|
||||
K_(remote_sql));
|
||||
J_COMMA();
|
||||
|
@ -53,6 +53,7 @@ struct ObRemoteSqlInfo
|
||||
ObRemoteSqlInfo() :
|
||||
use_ps_(false),
|
||||
is_batched_stmt_(false),
|
||||
is_original_ps_mode_(false),
|
||||
ps_param_cnt_(0),
|
||||
remote_sql_(),
|
||||
ps_params_(nullptr)
|
||||
@ -63,6 +64,7 @@ struct ObRemoteSqlInfo
|
||||
|
||||
bool use_ps_;
|
||||
bool is_batched_stmt_;
|
||||
bool is_original_ps_mode_;
|
||||
int32_t ps_param_cnt_;
|
||||
common::ObString remote_sql_;
|
||||
ParamStore *ps_params_;
|
||||
|
@ -331,6 +331,7 @@ OB_DEF_SERIALIZE(ObRemoteTask)
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < param_meta_count; ++i) {
|
||||
OB_UNIS_ENCODE(ps_params->at(i).get_param_flag());
|
||||
}
|
||||
OB_UNIS_ENCODE(remote_sql_info_->is_original_ps_mode_);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -367,6 +368,7 @@ OB_DEF_SERIALIZE_SIZE(ObRemoteTask)
|
||||
for (int64_t i = 0; i < param_meta_count; ++i) {
|
||||
OB_UNIS_ADD_LEN(ps_params->at(i).get_param_flag());
|
||||
}
|
||||
OB_UNIS_ADD_LEN(remote_sql_info_->is_original_ps_mode_);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
@ -429,6 +431,7 @@ OB_DEF_DESERIALIZE(ObRemoteTask)
|
||||
}
|
||||
}
|
||||
}
|
||||
OB_UNIS_DECODE(remote_sql_info_->is_original_ps_mode_);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -1685,6 +1685,7 @@ int ObSql::handle_remote_query(const ObRemoteSqlInfo &remote_sql_info,
|
||||
pc_ctx->fp_result_.pc_key_.key_id_ = 0;
|
||||
pc_ctx->fp_result_.pc_key_.name_ = trimed_stmt;
|
||||
pc_ctx->normal_parse_const_cnt_ = remote_sql_info.ps_params_->count();
|
||||
pc_ctx->is_original_ps_mode_ = remote_sql_info.is_original_ps_mode_;
|
||||
pc_ctx->set_is_ps_execute_stage();
|
||||
if (OB_FAIL(construct_param_store(*remote_sql_info.ps_params_, param_store))) {
|
||||
LOG_WARN("construct param store failed", K(ret));
|
||||
@ -2044,7 +2045,13 @@ int ObSql::generate_stmt(ParseResult &parse_result,
|
||||
resolver_ctx.is_ddl_from_primary_ = context.is_ddl_from_primary_;
|
||||
resolver_ctx.is_cursor_ = context.is_cursor_;
|
||||
resolver_ctx.is_batch_stmt_ = context.multi_stmt_item_.is_batched_multi_stmt();
|
||||
resolver_ctx.is_by_ordinal_ = parse_result.question_mark_ctx_.by_ordinal_;
|
||||
if (NULL != pc_ctx && pc_ctx->is_remote_executor_) {
|
||||
resolver_ctx.need_check_col_dup_
|
||||
= !(context.is_prepare_protocol_ && parse_result.question_mark_ctx_.by_ordinal_ && pc_ctx->is_original_ps_mode_);
|
||||
} else {
|
||||
resolver_ctx.need_check_col_dup_
|
||||
= !(context.is_prepare_protocol_ && parse_result.question_mark_ctx_.by_ordinal_);
|
||||
}
|
||||
resolver_ctx.external_param_info_.by_name_
|
||||
= parse_result.question_mark_ctx_.by_name_ || NULL != context.secondary_namespace_; //static sql in PL must be by name
|
||||
resolver_ctx.outline_parse_result_ = outline_parse_result;
|
||||
@ -3577,6 +3584,7 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx,
|
||||
param_store.pop_back();
|
||||
}
|
||||
pctx->get_remote_sql_info().use_ps_ = true;
|
||||
pctx->get_remote_sql_info().is_original_ps_mode_ = true;
|
||||
//从ps sql info中取出要执行的sql
|
||||
pctx->get_remote_sql_info().remote_sql_ = pc_ctx.sql_ctx_.cur_sql_;
|
||||
pctx->get_remote_sql_info().ps_params_ = ¶m_store;
|
||||
|
@ -293,6 +293,7 @@ struct ObPlanCacheCtx : public ObILibCacheCtx
|
||||
fixed_param_idx_(allocator),
|
||||
need_add_obj_stat_(true),
|
||||
is_inner_sql_(false),
|
||||
is_original_ps_mode_(false),
|
||||
ab_params_(NULL)
|
||||
{
|
||||
fp_result_.pc_key_.is_ps_mode_ = is_ps_mode_;
|
||||
@ -351,7 +352,8 @@ struct ObPlanCacheCtx : public ObILibCacheCtx
|
||||
K(ps_need_parameterized_),
|
||||
K(fixed_param_idx_),
|
||||
K(need_add_obj_stat_),
|
||||
K(is_inner_sql_)
|
||||
K(is_inner_sql_),
|
||||
K(is_original_ps_mode_)
|
||||
);
|
||||
bool is_ps_mode_; //control use which variables to do match
|
||||
|
||||
@ -398,6 +400,7 @@ struct ObPlanCacheCtx : public ObILibCacheCtx
|
||||
common::ObFixedArray<int64_t, common::ObIAllocator> fixed_param_idx_;
|
||||
bool need_add_obj_stat_;
|
||||
bool is_inner_sql_;
|
||||
bool is_original_ps_mode_;
|
||||
ParamStore *ab_params_; // arraybinding batch parameters,
|
||||
};
|
||||
|
||||
|
@ -2373,7 +2373,7 @@ int ObSelectResolver::is_need_check_col_dup(const ObRawExpr *expr, bool &need_ch
|
||||
if (OB_ISNULL(expr)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("is null", K(ret));
|
||||
} else if (!params_.is_prepare_protocol_ || !params_.is_by_ordinal_) {
|
||||
} else if (params_.need_check_col_dup_) {
|
||||
need_check = true;
|
||||
} else if (T_QUESTIONMARK == expr->get_expr_type()) {
|
||||
need_check = false;
|
||||
|
@ -341,7 +341,7 @@ struct ObResolverParams
|
||||
hidden_column_scope_(T_NONE_SCOPE),
|
||||
outline_parse_result_(NULL),
|
||||
is_execute_call_stmt_(false),
|
||||
is_by_ordinal_(false)
|
||||
need_check_col_dup_(true)
|
||||
{}
|
||||
bool is_force_trace_log() { return force_trace_log_; }
|
||||
|
||||
@ -404,7 +404,7 @@ public:
|
||||
ObStmtScope hidden_column_scope_; // record scope for first hidden column which need check hidden_column_visable in opt_param hint
|
||||
ParseResult *outline_parse_result_;
|
||||
bool is_execute_call_stmt_;
|
||||
bool is_by_ordinal_;
|
||||
bool need_check_col_dup_;
|
||||
};
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
|
Loading…
x
Reference in New Issue
Block a user