[to #50156156] fix serval bugs with anydata/composite/pkg state

This commit is contained in:
obdev
2023-06-07 04:18:06 +00:00
committed by ob-robot
parent 341986a4f6
commit 38519a70a1
6 changed files with 64 additions and 25 deletions

View File

@ -772,15 +772,18 @@ int ObResolverUtils::check_type_match(const pl::ObPLResolveCtx &resolve_ctx,
} else {
// element is composite type
uint64_t element_type_id = src_coll->get_element_desc().get_udt_id();
bool is_compatible = false;
OZ (ObPLResolver::check_composite_compatible(
NULL == resolve_ctx.params_.secondary_namespace_
? static_cast<const ObPLINS&>(resolve_ctx)
: static_cast<const ObPLINS&>(*resolve_ctx.params_.secondary_namespace_),
element_type_id, dst_pl_type.get_user_type_id(), is_compatible));
bool is_compatible = element_type_id == coll_type->get_element_type().get_user_type_id();
if (!is_compatible) {
OZ (ObPLResolver::check_composite_compatible(
NULL == resolve_ctx.params_.secondary_namespace_
? static_cast<const ObPLINS&>(resolve_ctx)
: static_cast<const ObPLINS&>(*resolve_ctx.params_.secondary_namespace_),
element_type_id, coll_type->get_element_type().get_user_type_id(), is_compatible));
}
if (OB_SUCC(ret) && !is_compatible) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("incorrect argument type", K(ret));
LOG_WARN("incorrect argument type",
K(ret), K(element_type_id), K(dst_pl_type), KPC(src_coll));
}
}
OX (match_info = (ObRoutineMatchInfo::MatchInfo(false, src_type, dst_type)));