diff --git a/src/sql/engine/expr/ob_expr_collection_construct.cpp b/src/sql/engine/expr/ob_expr_collection_construct.cpp index cf3c310486..9d16f02e71 100644 --- a/src/sql/engine/expr/ob_expr_collection_construct.cpp +++ b/src/sql/engine/expr/ob_expr_collection_construct.cpp @@ -119,6 +119,18 @@ int ObExprCollectionConstruct::cg_expr(ObExprCGCtx &op_cg_ctx, return ret; } +bool ObExprCollectionConstruct::is_match_type(const ObObj &element_obj, pl::ObPLType type) +{ + bool is_same = true; + if (pl::PL_NESTED_TABLE_TYPE == element_obj.get_meta().get_extend_type() || + pl::PL_VARRAY_TYPE == element_obj.get_meta().get_extend_type()) { + is_same = pl::PL_NESTED_TABLE_TYPE == type || pl::PL_VARRAY_TYPE == type; + } else { + is_same = element_obj.get_meta().get_extend_type() == type; + } + return is_same; +} + int ObExprCollectionConstruct::eval_collection_construct(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum) diff --git a/src/sql/engine/expr/ob_expr_collection_construct.h b/src/sql/engine/expr/ob_expr_collection_construct.h index 90a54c2f12..438e1e3a34 100644 --- a/src/sql/engine/expr/ob_expr_collection_construct.h +++ b/src/sql/engine/expr/ob_expr_collection_construct.h @@ -50,6 +50,7 @@ public: const ObRawExpr &raw_expr, ObExpr &rt_expr) const override; static int eval_collection_construct(const ObExpr &expr, ObEvalCtx &ctx, ObDatum &expr_datum); + static bool is_match_type(const ObObj &element_obj, pl::ObPLType type); struct ExtraInfo : public ObIExprExtraInfo {