[xml bugfix] xmlserialize encoding yacc and nvarchar insert into xml hang

This commit is contained in:
obdev
2023-06-16 09:47:54 +00:00
committed by ob-robot
parent 12e2837207
commit 782118285b
4 changed files with 20 additions and 124 deletions

View File

@ -7720,7 +7720,8 @@ int cast_to_udt_not_support(const sql::ObExpr &expr, sql::ObEvalCtx &ctx, sql::O
// other udts
// ORA-00932: inconsistent datatypes: expected PLSQL INDEX TABLE got NUMBER
// currently other types to udt not supported
ret = OB_ERR_INVALID_TYPE_FOR_OP;
ret = OB_ERR_INVALID_XML_DATATYPE;
LOG_USER_ERROR(OB_ERR_INVALID_XML_DATATYPE, "ANYDATA", ob_obj_type_str(in_obj_meta.get_type()));
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_));
}
@ -7753,6 +7754,17 @@ int cast_udt_to_other_not_support(const sql::ObExpr &expr, sql::ObEvalCtx &ctx,
return ret;
}
////////////////////////////////////////////////////////////
// str -> udt;
CAST_FUNC_NAME(string, udt)
{
EVAL_STRING_ARG()
{
ret = OB_NOT_SUPPORTED;
}
return ret;
}
CAST_FUNC_NAME(udt, string)
{
// udt(xmltype) can be null: select dump(xmlparse(document NULL)) from dual;
@ -9818,7 +9830,7 @@ ObExpr::EvalFunc OB_DATUM_CAST_ORACLE_IMPLICIT[ObMaxTC][ObMaxTC] =
string_lob,/*lob*/
string_json,/*json*/
cast_not_support,/*geometry*/
cast_to_udt_not_support,/*udt*/
string_udt,/*udt*/
},
{
/*extend -> XXX*/
@ -10524,7 +10536,7 @@ ObExpr::EvalFunc OB_DATUM_CAST_ORACLE_EXPLICIT[ObMaxTC][ObMaxTC] =
cast_inconsistent_types,/*lob*/
cast_inconsistent_types,/*json*/
cast_not_support,/*geometry*/
cast_to_udt_not_support,/*udt*/
string_udt,/*udt*/
},
{
/*extend -> XXX*/
@ -12539,6 +12551,9 @@ int ObDatumCaster::setup_cast_expr(const ObDatumMeta &dst_type,
}
}
// implicit cast donot use these, so we set it all invalid.
if (ob_is_user_defined_pl_type(src_expr.obj_meta_.get_type()) && dst_type.type_ == ObUserDefinedSQLType) {
cast_expr.obj_meta_.set_sql_udt(ObXMLSqlType);
}
cast_expr.parents_ = NULL;
cast_expr.parent_cnt_ = 0;
cast_expr.basic_funcs_ = NULL;

View File

@ -28,7 +28,7 @@ namespace sql
{
ObExprUpdateXml::ObExprUpdateXml(common::ObIAllocator &alloc)
: ObFuncExprOperator(alloc, T_FUN_SYS_UPDATE_XML, N_UPDATEXML, MORE_THAN_TWO, NOT_VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION)
: ObFuncExprOperator(alloc, T_FUN_SYS_UPDATE_XML, N_UPDATEXML, MORE_THAN_TWO, VALID_FOR_GENERATED_COL, NOT_ROW_DIMENSION)
{
}