diff --git a/src/sql/engine/expr/ob_datum_cast.cpp b/src/sql/engine/expr/ob_datum_cast.cpp index 118e6d1e3f..f06c33eaae 100644 --- a/src/sql/engine/expr/ob_datum_cast.cpp +++ b/src/sql/engine/expr/ob_datum_cast.cpp @@ -7681,7 +7681,7 @@ int cast_to_udt_not_support(const sql::ObExpr &expr, sql::ObEvalCtx &ctx, sql::O // other udts // ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER // currently other types to udt not supported - ret = OB_ERR_UNEXPECTED; + ret = OB_ERR_INVALID_TYPE_FOR_OP; LOG_WARN_RET(ret, "not expected obj type convert", K(in_obj_meta), K(out_obj_meta), K(out_obj_meta.get_subschema_id()), K(expr.extra_)); } @@ -7707,7 +7707,7 @@ int cast_udt_to_other_not_support(const sql::ObExpr &expr, sql::ObEvalCtx &ctx, // other udts // ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER // currently other types to udt not supported - ret = OB_ERR_UNEXPECTED; + ret = OB_ERR_INVALID_TYPE_FOR_OP; LOG_WARN_RET(ret, "not expected obj type convert", K(in_obj_meta), K(out_obj_meta), K(out_obj_meta.get_subschema_id()), K(expr.extra_)); } diff --git a/src/sql/engine/expr/ob_expr_xml_serialize.cpp b/src/sql/engine/expr/ob_expr_xml_serialize.cpp index c87deb7252..b2dcd4d78a 100644 --- a/src/sql/engine/expr/ob_expr_xml_serialize.cpp +++ b/src/sql/engine/expr/ob_expr_xml_serialize.cpp @@ -92,7 +92,7 @@ int ObExprXmlSerialize::get_dest_type(const ObExprResType as_type, ObExprResType ObCollationType cs_type = static_cast(parse_node.int16_values_[OB_NODE_CAST_COLL_IDX]); dst_type.set_type(obj_type); dst_type.set_collation_type(cs_type); - if (ob_is_varchar_type(dst_type.get_type(), dst_type.get_collation_type())) { + if (ob_is_varchar_type(dst_type.get_type(), dst_type.get_collation_type()) || ob_is_nvarchar2(obj_type)) { dst_type.set_full_length(parse_node.int32_values_[1], as_type.get_accuracy().get_length_semantics()); } else if (ob_is_clob(dst_type.get_type(), dst_type.get_collation_type()) || ob_is_blob(dst_type.get_type(), dst_type.get_collation_type())) { diff --git a/src/sql/engine/expr/ob_expr_xmlparse.cpp b/src/sql/engine/expr/ob_expr_xmlparse.cpp index 28bccd6cdb..2f5ea596e9 100644 --- a/src/sql/engine/expr/ob_expr_xmlparse.cpp +++ b/src/sql/engine/expr/ob_expr_xmlparse.cpp @@ -12,6 +12,7 @@ */ #include "ob_expr_xmlparse.h" +#include "sql/engine/ob_exec_context.h" #include "ob_expr_xml_func_helper.h" #define USING_LOG_PREFIX SQL_ENG