From 7b1027ca62f552525a28312692ad7e02527cd1e6 Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 21 Jun 2023 22:48:38 +0000 Subject: [PATCH] [xml bugfix] Keep content only the empty characters before the text in the TEXT node --- src/sql/engine/expr/ob_datum_cast.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sql/engine/expr/ob_datum_cast.cpp b/src/sql/engine/expr/ob_datum_cast.cpp index ea598666f..969f5e0aa 100644 --- a/src/sql/engine/expr/ob_datum_cast.cpp +++ b/src/sql/engine/expr/ob_datum_cast.cpp @@ -8622,7 +8622,8 @@ int anytype_to_varchar_char_explicit(const sql::ObExpr &expr, ret = OB_SUCCESS; } else if ((ob_is_clob(src_meta.type_, src_meta.cs_type_) || ob_is_clob_locator(src_meta.type_, src_meta.cs_type_) - || expr.args_[0]->obj_meta_.is_xml_sql_type()) && lib::is_oracle_mode()) { + || expr.args_[0]->obj_meta_.is_xml_sql_type() + || (expr.args_[0]->type_ == T_FUN_SYS_CAST && expr.args_[0]->args_[0]->obj_meta_.is_xml_sql_type())) && lib::is_oracle_mode()) { if (ob_is_nchar(expr.datum_meta_.type_) || ob_is_char(expr.datum_meta_.type_, expr.datum_meta_.cs_type_)) { ret = OB_OPERATE_OVERFLOW;