[to #49178989] fix mysqltest

This commit is contained in:
obdev
2023-04-21 06:45:22 +00:00
committed by ob-robot
parent a9098c4fe7
commit 51e24b0b36
3 changed files with 21 additions and 8 deletions

View File

@ -1039,14 +1039,16 @@ public:
access_index_(common::OB_INVALID_INDEX),
udf_info_(),
sys_func_expr_(NULL),
params_() {}
params_(),
has_brackets_(false) {}
ObObjAccessIdent(const common::ObString &name, int64_t index = common::OB_INVALID_INDEX)
: type_(UNKNOWN),
access_name_(name),
access_index_(index),
udf_info_(),
sys_func_expr_(NULL),
params_() {}
params_(),
has_brackets_(false) {}
virtual ~ObObjAccessIdent() {}
int assign(const ObObjAccessIdent &other)
@ -1056,6 +1058,7 @@ public:
access_index_ = other.access_index_;
udf_info_ = other.udf_info_;
sys_func_expr_ = other.sys_func_expr_;
has_brackets_ = other.has_brackets_;
return params_.assign(other.params_);
}
ObObjAccessIdent &operator =(const ObObjAccessIdent &other)
@ -1105,6 +1108,7 @@ public:
ObSysFunRawExpr *sys_func_expr_;
//a.f(x,y)(m,n)里的x、y、m、n都是f的参数,但是x、y的param_level_是0,m、n是1
common::ObSEArray<std::pair<ObRawExpr*, int64_t>, 4, common::ModulePageAllocator, true> params_;
bool has_brackets_; // may has empty (), record it.
};
class ObColumnRefRawExpr;

View File

@ -879,6 +879,16 @@ int ObResolverUtils::check_match(const pl::ObPLResolveCtx &resolve_ctx,
ObRawExpr *first_arg = expr_params.at(0);
if (first_arg->has_flag(IS_UDT_UDF_SELF_PARAM)) {
// do nothing, may be we can check if routine is static or not
} else if (routine_info->is_udt_cons()) {
if (expr_params.count() > 0 && 1 == routine_info->get_param_count()) {
ret = OB_ERR_SP_WRONG_ARG_NUM;
LOG_WARN("argument count not match",
K(ret), K(expr_params.count()), K(routine_info->get_param_count()));
} else {
// construct function & no self real paremeter
OX (match_info.match_info_.at(0) = (ObRoutineMatchInfo::MatchInfo(false, ObExtendType, ObExtendType)));
OX (offset = 1);
}
} else if (routine_info->is_udt_routine()
&& !routine_info->is_udt_static_routine()
&& expr_params.count() != routine_info->get_param_count()) {
@ -893,8 +903,7 @@ int ObResolverUtils::check_match(const pl::ObPLResolveCtx &resolve_ctx,
OZ (get_type_and_type_id(first_arg, src_type, src_type_id));
}
if (OB_SUCC(ret)
&& (src_type_id != routine_info->get_package_id()
|| routine_info->is_udt_cons())) {
&& (src_type_id != routine_info->get_package_id())) {
// set first param matched
OX (match_info.match_info_.at(0) = (ObRoutineMatchInfo::MatchInfo(false, src_type, src_type)));
OX (offset = 1);