set the initial value of wrs to scn min

This commit is contained in:
obdev
2022-11-28 02:55:06 +00:00
committed by ob-robot
parent 99d4f56fec
commit 87a9357186
406 changed files with 6473 additions and 50308 deletions

View File

@ -2316,7 +2316,9 @@ int ObRawExprResolverImpl::process_datatype_or_questionmark(const ParseNode &nod
c_expr->set_expr_obj_meta(question_mark_meta);
if (NULL == ctx_.external_param_info_) {
/*do nothing...*/
} else if (ctx_.is_for_dynamic_sql_ || ctx_.is_for_dbms_sql_) {
} else if (ctx_.is_for_dbms_sql_
|| (ctx_.is_for_dynamic_sql_ && OB_NOT_NULL(session_info->get_pl_context()))){
//NOTICE: only need to process PL dynamic sql and dbms sql
/*dynmaic and dbms sql already prepare question mark in parse stage.*/
bool need_save = true;
for (int64_t i = 0; OB_SUCC(ret) && i < ctx_.external_param_info_->count(); ++i) {
@ -2382,6 +2384,16 @@ int ObRawExprResolverImpl::process_datatype_or_questionmark(const ParseNode &nod
c_expr->set_accuracy(param.get_accuracy());
c_expr->set_result_flag(param.get_result_flag()); // not_null etc
c_expr->set_param(param);
sql::ObExprResType result_type = c_expr->get_result_type();
if (result_type.get_length() == -1) {
if (result_type.is_varchar() || result_type.is_nvarchar2()) {
result_type.set_length(OB_MAX_ORACLE_VARCHAR_LENGTH);
} else if (result_type.is_char() || result_type.is_nchar()) {
result_type.set_length(OB_MAX_ORACLE_CHAR_LENGTH_BYTE);
}
}
c_expr->set_result_type(result_type);
}
//execute阶段不需要统计prepare_param_count_的个数
// ctx_.prepare_param_count_++;