From df0b652003b4a118f30fcc974c4c470a25f57c4c Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 28 Jun 2023 06:48:15 +0000 Subject: [PATCH] [xml bugfix]xmltype column bugfix and space namespace error --- src/sql/resolver/ddl/ob_ddl_resolver.cpp | 11 ++++++++--- src/sql/resolver/expr/ob_raw_expr_util.cpp | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/sql/resolver/ddl/ob_ddl_resolver.cpp b/src/sql/resolver/ddl/ob_ddl_resolver.cpp index aca6c2d1c6..2fbb8c4f35 100644 --- a/src/sql/resolver/ddl/ob_ddl_resolver.cpp +++ b/src/sql/resolver/ddl/ob_ddl_resolver.cpp @@ -5542,9 +5542,14 @@ int ObDDLResolver::calc_default_value(share::schema::ObColumnSchemaV2 &column, ObObjType data_type = column.get_data_type(); ObCollationType collation_type = column.get_collation_type(); if (lib::is_oracle_mode() && column.is_xmltype()) { - // use hidden column type, treat as clob, wil transform to blob in _makexmlbinary - data_type = ObLongTextType; - collation_type = CS_TYPE_UTF8MB4_BIN; + if (ob_is_user_defined_sql_type(data_type)) { + // bugfix: 50351856 + default_value.meta_.set_sql_udt(ObXMLSqlType); + } else { + // use hidden column type, treat as clob, wil transform to blob in _makexmlbinary + data_type = ObLongTextType; + collation_type = CS_TYPE_UTF8MB4_BIN; + } } ObObj dest_obj; const ObDataTypeCastParams dtc_params(tz_info_wrap.get_time_zone_info(), nls_formats, CS_TYPE_INVALID, CS_TYPE_INVALID, CS_TYPE_UTF8MB4_GENERAL_CI); diff --git a/src/sql/resolver/expr/ob_raw_expr_util.cpp b/src/sql/resolver/expr/ob_raw_expr_util.cpp index 451ffb05ca..9fb6b3455a 100644 --- a/src/sql/resolver/expr/ob_raw_expr_util.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_util.cpp @@ -6488,7 +6488,9 @@ int ObRawExprUtils::check_composite_cast(ObRawExpr *&expr, ObSchemaChecker &sche } } else if (ObExtendType == obj_type && OB_INVALID_ID != udt_id - && src->get_expr_type() != T_QUESTIONMARK) { + && !(src->get_expr_type() == T_QUESTIONMARK || + (src->get_expr_type() == T_FUN_SYS_CAST + && src->get_param_expr(0)->get_expr_type() == T_QUESTIONMARK))) { if (ObNullType == src->get_result_type().get_type()) { // do nothing } else if (src->get_result_type().is_user_defined_sql_type()) {