fix: xml chinese charactor truncate length no correct & nchar not support & error code not consistent at in or = expr

This commit is contained in:
obdev
2023-05-08 02:42:01 +00:00
committed by ob-robot
parent 1d1d1e009e
commit 2343aa1174
3 changed files with 4 additions and 3 deletions

View File

@ -7681,7 +7681,7 @@ int cast_to_udt_not_support(const sql::ObExpr &expr, sql::ObEvalCtx &ctx, sql::O
// other udts // other udts
// ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER // ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER
// currently other types to udt not supported // 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), 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_)); 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 // other udts
// ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER // ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER
// currently other types to udt not supported // 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), 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_)); K(out_obj_meta.get_subschema_id()), K(expr.extra_));
} }

View File

@ -92,7 +92,7 @@ int ObExprXmlSerialize::get_dest_type(const ObExprResType as_type, ObExprResType
ObCollationType cs_type = static_cast<ObCollationType>(parse_node.int16_values_[OB_NODE_CAST_COLL_IDX]); ObCollationType cs_type = static_cast<ObCollationType>(parse_node.int16_values_[OB_NODE_CAST_COLL_IDX]);
dst_type.set_type(obj_type); dst_type.set_type(obj_type);
dst_type.set_collation_type(cs_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()); 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()) || } 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())) { ob_is_blob(dst_type.get_type(), dst_type.get_collation_type())) {

View File

@ -12,6 +12,7 @@
*/ */
#include "ob_expr_xmlparse.h" #include "ob_expr_xmlparse.h"
#include "sql/engine/ob_exec_context.h"
#include "ob_expr_xml_func_helper.h" #include "ob_expr_xml_func_helper.h"
#define USING_LOG_PREFIX SQL_ENG #define USING_LOG_PREFIX SQL_ENG