bugfix: decode adaptation for xml && allow filter for count arg in xpath && filter result cache
This commit is contained in:
@ -7739,10 +7739,23 @@ int cast_udt_to_other_not_support(const sql::ObExpr &expr, sql::ObEvalCtx &ctx,
|
||||
const ObObjMeta &in_obj_meta = expr.args_[0]->obj_meta_;
|
||||
const ObObjMeta &out_obj_meta = expr.obj_meta_;
|
||||
if (in_obj_meta.is_xml_sql_type()) {
|
||||
// only allow cast basic types to invalid CAST to a type that is not a nested table or VARRAY
|
||||
ret = OB_ERR_INVALID_TYPE_FOR_OP;
|
||||
LOG_WARN_RET(ret, "inconsistent datatypes", K(in_obj_meta), K(out_obj_meta),
|
||||
K(out_obj_meta.get_subschema_id()), K(expr.extra_));
|
||||
if (out_obj_meta.is_xml_sql_type()) {
|
||||
ObDatum *child_res = NULL;
|
||||
if (OB_FAIL(expr.args_[0]->eval(ctx, child_res))) {
|
||||
LOG_WARN("eval arg failed", K(ret), K(ctx));
|
||||
} else if (child_res->is_null() ||
|
||||
(lib::is_oracle_mode() && 0 == child_res->len_
|
||||
&& ObLongTextType != expr.args_[0]->datum_meta_.type_)) {
|
||||
res_datum.set_null();
|
||||
} else {
|
||||
res_datum.set_datum(*child_res);
|
||||
}
|
||||
} else {
|
||||
// only allow cast basic types to invalid CAST to a type that is not a nested table or VARRAY
|
||||
ret = OB_ERR_INVALID_TYPE_FOR_OP;
|
||||
LOG_WARN_RET(ret, "inconsistent datatypes", K(in_obj_meta), K(out_obj_meta),
|
||||
K(out_obj_meta.get_subschema_id()), K(expr.extra_));
|
||||
}
|
||||
} else {
|
||||
// other udts
|
||||
// ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER
|
||||
|
||||
@ -654,6 +654,8 @@ int ObExprCast::adjust_udt_cast_type(const ObExprResType &src_type, ObExprResTyp
|
||||
ret = OB_NOT_SUPPORTED;
|
||||
LOG_WARN("cast unsupported sql udt type to pl udt type", K(ret), K(src_type), K(dst_type));
|
||||
}
|
||||
} else if (dst_type.is_user_defined_sql_type()) {
|
||||
dst_type.set_subschema_id(ObXMLSqlType);
|
||||
}
|
||||
} else if (src_type.is_null()) {
|
||||
if (dst_type.get_type() == ObUserDefinedSQLType) {
|
||||
|
||||
@ -62,6 +62,9 @@ int ObExprOracleDecode::calc_result_typeN(ObExprResType &type,
|
||||
LOG_USER_ERROR(OB_ERR_INVALID_TYPE_FOR_OP, "-",
|
||||
ob_obj_type_str(types_stack[0].get_type()));
|
||||
LOG_WARN("invalid type of parameter", K(ret), K(types_stack[0]));
|
||||
} else if (lib::is_oracle_mode() && types_stack[CALC_TYPE_INDEX].get_type() == ObUserDefinedSQLType) {
|
||||
ret = OB_ERR_NO_ORDER_MAP_SQL;
|
||||
LOG_WARN("cannot ORDER objects without MAP or ORDER method", K(ret));
|
||||
}
|
||||
for (int64_t i = 1; OB_SUCC(ret) && i < param_num; i += 2) {
|
||||
if (has_default && i == param_num - 1) {
|
||||
@ -286,6 +289,9 @@ int ObExprOracleDecode::calc_result_typeN(ObExprResType &type,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && lib::is_oracle_mode() &&type.get_type() == ObUserDefinedSQLType) {
|
||||
type.set_subschema_id(ObXMLSqlType);
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (ob_is_otimestamp_type(types_stack[RESULT_TYPE_INDEX].get_type())) {
|
||||
|
||||
Reference in New Issue
Block a user