From 63af839d05ec688cc7b098c623b8de230329c19c Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 11 Jul 2023 13:12:38 +0000 Subject: [PATCH] [xml] update xmltype using clob in pl bugfix --- src/sql/engine/expr/ob_expr_extract_value.cpp | 19 +++++++++---------- src/sql/engine/expr/ob_expr_extract_xml.cpp | 19 +++++++++---------- src/sql/engine/expr/ob_expr_update_xml.cpp | 2 ++ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/sql/engine/expr/ob_expr_extract_value.cpp b/src/sql/engine/expr/ob_expr_extract_value.cpp index 2f844f4f6a..d8cc80ff0c 100644 --- a/src/sql/engine/expr/ob_expr_extract_value.cpp +++ b/src/sql/engine/expr/ob_expr_extract_value.cpp @@ -56,17 +56,16 @@ int ObExprExtractValue::calc_result_typeN(ObExprResType &type, ret = OB_ERR_INVALID_TYPE_FOR_OP; LOG_USER_ERROR(OB_ERR_INVALID_TYPE_FOR_OP, "-", "-"); LOG_WARN("inconsistent datatypes", K(ret), K(ob_obj_type_str(in_type))); - } else { - for (int8_t i = 1; i < param_num && OB_SUCC(ret); i++) { - ObObjType param_type = types[i].get_type(); - if (param_type == ObNullType) { - } else if (ob_is_string_type(param_type)) { - if (types[i].get_charset_type() != CHARSET_UTF8MB4) { - types[i].set_calc_collation_type(CS_TYPE_UTF8MB4_BIN); - } - } else { - ret = OB_ERR_INVALID_XPATH_EXPRESSION; + } + for (int8_t i = 1; i < param_num && OB_SUCC(ret); i++) { + ObObjType param_type = types[i].get_type(); + if (param_type == ObNullType) { + } else if (ob_is_string_type(param_type)) { + if (types[i].get_charset_type() != CHARSET_UTF8MB4) { + types[i].set_calc_collation_type(CS_TYPE_UTF8MB4_BIN); } + } else { + ret = OB_ERR_INVALID_XPATH_EXPRESSION; } } diff --git a/src/sql/engine/expr/ob_expr_extract_xml.cpp b/src/sql/engine/expr/ob_expr_extract_xml.cpp index 0ee59e8221..2755c989a5 100644 --- a/src/sql/engine/expr/ob_expr_extract_xml.cpp +++ b/src/sql/engine/expr/ob_expr_extract_xml.cpp @@ -55,17 +55,16 @@ int ObExprExtractXml::calc_result_typeN(ObExprResType &type, ret = OB_ERR_INVALID_TYPE_FOR_OP; LOG_USER_ERROR(OB_ERR_INVALID_TYPE_FOR_OP, "-", "-"); LOG_WARN("inconsistent datatypes", K(ret), K(ob_obj_type_str(in_type))); - } else { - for (int8_t i = 1; i < param_num && OB_SUCC(ret); i++) { - ObObjType param_type = types[i].get_type(); - if (param_type == ObNullType) { - } else if (ob_is_string_type(param_type)) { - if (types[i].get_charset_type() != CHARSET_UTF8MB4) { - types[i].set_calc_collation_type(CS_TYPE_UTF8MB4_BIN); - } - } else { - ret = OB_ERR_INVALID_XPATH_EXPRESSION; + } + for (int8_t i = 1; i < param_num && OB_SUCC(ret); i++) { + ObObjType param_type = types[i].get_type(); + if (param_type == ObNullType) { + } else if (ob_is_string_type(param_type)) { + if (types[i].get_charset_type() != CHARSET_UTF8MB4) { + types[i].set_calc_collation_type(CS_TYPE_UTF8MB4_BIN); } + } else { + ret = OB_ERR_INVALID_XPATH_EXPRESSION; } } diff --git a/src/sql/engine/expr/ob_expr_update_xml.cpp b/src/sql/engine/expr/ob_expr_update_xml.cpp index 3c83284ddc..7952062098 100644 --- a/src/sql/engine/expr/ob_expr_update_xml.cpp +++ b/src/sql/engine/expr/ob_expr_update_xml.cpp @@ -53,6 +53,8 @@ int ObExprUpdateXml::calc_result_typeN(ObExprResType &type, ret = OB_ERR_INVALID_TYPE_FOR_OP; LOG_USER_ERROR(OB_ERR_INVALID_TYPE_FOR_OP, "-", "-"); LOG_WARN("inconsistent datatypes", K(ret), K(ob_obj_type_str(types[0].get_type()))); + } + if (OB_FAIL(ret)) { } else { bool has_ns_str = (param_num - 1) % 2 == 1; int64_t xpath_value_end = has_ns_str ? param_num - 1 : param_num;