[xml bugfix] Compatible error codes related to xml type
This commit is contained in:
		| @ -323,8 +323,13 @@ int ObExprFuncPartHash::eval_oracle_part_hash( | |||||||
|     } else if (d->is_null()) { |     } else if (d->is_null()) { | ||||||
|       // do nothing |       // do nothing | ||||||
|     } else if (!is_oracle_supported_type(arg.datum_meta_.type_)) { |     } else if (!is_oracle_supported_type(arg.datum_meta_.type_)) { | ||||||
|       ret = OB_INVALID_ARGUMENT; |       if (ob_is_user_defined_sql_type(arg.datum_meta_.type_)) { | ||||||
|       LOG_WARN("wrong type", K(ret), K(arg.datum_meta_)); |         ret = OB_ERR_INVALID_XML_DATATYPE; | ||||||
|  |         LOG_USER_ERROR(OB_ERR_INVALID_XML_DATATYPE, "-", "ANYDATA"); | ||||||
|  |       } else { | ||||||
|  |         ret = OB_INVALID_ARGUMENT; | ||||||
|  |         LOG_WARN("wrong type", K(ret), K(arg.datum_meta_)); | ||||||
|  |       } | ||||||
|     } else { |     } else { | ||||||
|       if (ObCharType == arg.datum_meta_.type_ |       if (ObCharType == arg.datum_meta_.type_ | ||||||
|           || ObNCharType == arg.datum_meta_.type_) { |           || ObNCharType == arg.datum_meta_.type_) { | ||||||
|  | |||||||
| @ -804,7 +804,12 @@ int ObExprOperator::aggregate_charsets( | |||||||
|     ObObjMeta coll; |     ObObjMeta coll; | ||||||
|     for (int i = 0; OB_SUCC(ret) && i < param_num; ++i) { |     for (int i = 0; OB_SUCC(ret) && i < param_num; ++i) { | ||||||
|       coll.reset(); |       coll.reset(); | ||||||
|       coll.set_collation_type(types[i].get_collation_type()); |       // issue:49962420 The xml type calls get_collation_type() to return the result of binary, here is set to utf8 | ||||||
|  |       if (type.is_string_type() && types[i].is_xml_sql_type()) { | ||||||
|  |         coll.set_collation_type(ObCollationType::CS_TYPE_UTF8MB4_BIN); | ||||||
|  |       } else { | ||||||
|  |         coll.set_collation_type(types[i].get_collation_type()); | ||||||
|  |       } | ||||||
|       coll.set_collation_level(types[i].get_collation_level()); |       coll.set_collation_level(types[i].get_collation_level()); | ||||||
|       ret = coll_types.push_back(coll); |       ret = coll_types.push_back(coll); | ||||||
|     } // end for |     } // end for | ||||||
|  | |||||||
| @ -1920,7 +1920,10 @@ int ObRawExprDeduceType::check_median_percentile_param(ObAggFunRawExpr &expr) | |||||||
|     LOG_WARN("get unexpected null", K(ret), K(expr)); |     LOG_WARN("get unexpected null", K(ret), K(expr)); | ||||||
|   } else if (T_FUN_GROUP_PERCENTILE_CONT == expr_type || |   } else if (T_FUN_GROUP_PERCENTILE_CONT == expr_type || | ||||||
|              T_FUN_GROUP_PERCENTILE_DISC == expr_type) { |              T_FUN_GROUP_PERCENTILE_DISC == expr_type) { | ||||||
|     if (!expr.get_param_expr(0)->is_const_expr()) { |     if (expr.get_param_expr(0)->get_result_type().is_user_defined_sql_type()) { | ||||||
|  |       ret = OB_ERR_INVALID_XML_DATATYPE; | ||||||
|  |       LOG_USER_ERROR(OB_ERR_INVALID_XML_DATATYPE, "NUMBER", "ANYDATA"); | ||||||
|  |     } else if (!expr.get_param_expr(0)->is_const_expr()) { | ||||||
|       ret = OB_ERR_ARGUMENT_SHOULD_CONSTANT; |       ret = OB_ERR_ARGUMENT_SHOULD_CONSTANT; | ||||||
|       LOG_WARN("Argument should be a constant.", K(ret)); |       LOG_WARN("Argument should be a constant.", K(ret)); | ||||||
|     } else if (!ob_is_numeric_type(expr.get_param_expr(0)->get_result_type().get_type())) { |     } else if (!ob_is_numeric_type(expr.get_param_expr(0)->get_result_type().get_type())) { | ||||||
| @ -1985,7 +1988,8 @@ int ObRawExprDeduceType::check_group_aggr_param(ObAggFunRawExpr &expr) | |||||||
|       } else if ((ob_is_user_defined_sql_type(param_expr->get_data_type()) |       } else if ((ob_is_user_defined_sql_type(param_expr->get_data_type()) | ||||||
|                     || ob_is_user_defined_pl_type(param_expr->get_data_type())) |                     || ob_is_user_defined_pl_type(param_expr->get_data_type())) | ||||||
|                  && (expr.get_expr_type() == T_FUN_MAX |                  && (expr.get_expr_type() == T_FUN_MAX | ||||||
|                      || expr.get_expr_type() == T_FUN_MIN)) { |                      || expr.get_expr_type() == T_FUN_MIN | ||||||
|  |                      || expr.get_expr_type() == T_FUN_GROUPING)) { | ||||||
|         // other udt types not run here, xmltype does not have order or map member function for compare |         // other udt types not run here, xmltype does not have order or map member function for compare | ||||||
|         ret = OB_ERR_NO_ORDER_MAP_SQL; |         ret = OB_ERR_NO_ORDER_MAP_SQL; | ||||||
|         LOG_WARN("does not have order or map member function for compare", |         LOG_WARN("does not have order or map member function for compare", | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 obdev
					obdev