[xml bugfix] coalesce expr adapt xml and nvl expr adapt xml

This commit is contained in:
obdev
2023-07-13 11:59:47 +00:00
committed by ob-robot
parent 65bb8d8f29
commit eaac55aef7
2 changed files with 339 additions and 134 deletions

View File

@ -72,6 +72,15 @@ int ObExprNvlUtil::calc_result_type(ObExprResType &type,
type.set_result_flag(NOT_NULL_FLAG); type.set_result_flag(NOT_NULL_FLAG);
} }
} }
if (OB_SUCC(ret) && ob_is_user_defined_sql_type(type.get_type())) {
if (type1.is_xml_sql_type() || type2.is_xml_sql_type()) {
type.set_subschema_id(ObXMLSqlType);
} else {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unsupported udt failed", K(ret), K(type1), K(type2));
}
}
return ret; return ret;
} }

View File

@ -699,6 +699,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObRawType, /*Raw*/ ObRawType, /*Raw*/
ObIntervalYMType, /*Interval*/ ObIntervalYMType, /*Interval*/
ObURowIDType, /*Rowid*/ ObURowIDType, /*Rowid*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObUserDefinedSQLType, /*User Defined Type*/
}, },
{ {
// treat int as number, because const 1 will be parsed to bigint 1, not number 1 now. // treat int as number, because const 1 will be parsed to bigint 1, not number 1 now.
@ -724,6 +728,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObNumberType,/*Raw*/ ObNumberType,/*Raw*/
ObMaxType, /*Interval*/ ObMaxType, /*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*uint -> XXX*/ /*uint -> XXX*/
@ -748,6 +756,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType, /*Interval*/ ObMaxType, /*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*float -> XXX*/ /*float -> XXX*/
@ -772,6 +784,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObFloatType,/*Raw*/ ObFloatType,/*Raw*/
ObMaxType, /*Interval*/ ObMaxType, /*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*double -> XXX*/ /*double -> XXX*/
@ -796,6 +812,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObDoubleType,/*Raw*/ ObDoubleType,/*Raw*/
ObMaxType, /*Interval*/ ObMaxType, /*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*number -> XXX*/ /*number -> XXX*/
@ -820,6 +840,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObNumberType,/*Raw*/ ObNumberType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*datetime -> XXX*/ /*datetime -> XXX*/
@ -844,6 +868,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObDateTimeType,/*Raw*/ ObDateTimeType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*date -> XXX*/ /*date -> XXX*/
@ -868,6 +896,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*time -> XXX*/ /*time -> XXX*/
@ -892,6 +924,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*year -> XXX*/ /*year -> XXX*/
@ -916,6 +952,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*string -> XXX*/ /*string -> XXX*/
@ -940,6 +980,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObVarcharType,/*Raw*/ ObVarcharType,/*Raw*/
ObVarcharType,/*Interval*/ ObVarcharType,/*Interval*/
ObVarcharType,/*RowID*/ ObVarcharType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObVarcharType, /*User Defined Type*/
}, },
{ {
/*extend -> XXX*/ /*extend -> XXX*/
@ -964,6 +1008,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObUserDefinedSQLType, /*User Defined Type*/
}, },
{ {
/*unknown -> XXX*/ /*unknown -> XXX*/
@ -988,6 +1036,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*text -> XXX*/ /*text -> XXX*/
@ -1012,6 +1064,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObLongTextType,/*Raw*/ ObLongTextType,/*Raw*/
ObLongTextType,/*Interval*/ ObLongTextType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*bit -> XXX*/ /*bit -> XXX*/
@ -1036,6 +1092,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*EnumSet -> XXX*/ /*EnumSet -> XXX*/
@ -1060,6 +1120,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*EnumSetInner -> XXX*/ /*EnumSetInner -> XXX*/
@ -1084,6 +1148,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*otimestamp-> XXX*/ /*otimestamp-> XXX*/
@ -1108,6 +1176,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*Raw-> XXX*/ /*Raw-> XXX*/
@ -1132,6 +1204,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObRawType,/*Raw*/ ObRawType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObMaxType, /*RowID*/ ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*Interval-> XXX*/ /*Interval-> XXX*/
@ -1156,6 +1232,10 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObIntervalYMType,/*Interval*/ ObIntervalYMType,/*Interval*/
ObMaxType,/*RowID*/ ObMaxType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
}, },
{ {
/*RowID-> XXX*/ /*RowID-> XXX*/
@ -1180,5 +1260,121 @@ static const ObObjType NVL_TYPE_PROMOTION_ORACLE[ObMaxTC][ObMaxTC] =
ObMaxType,/*Raw*/ ObMaxType,/*Raw*/
ObMaxType,/*Interval*/ ObMaxType,/*Interval*/
ObURowIDType,/*RowID*/ ObURowIDType,/*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
},
{
/*Lob -> XXX*/
ObMaxType, /*null*/
ObMaxType, /*int*/
ObMaxType, /*uint*/
ObMaxType, /*float*/
ObMaxType, /*double*/
ObMaxType, /*number*/
ObMaxType, /*datetime*/
ObMaxType, /*date*/
ObMaxType, /*time*/
ObMaxType, /*year*/
ObMaxType, /*string*/
ObMaxType, /*extend*/
ObMaxType, /*unknown*/
ObMaxType, /*text*/
ObMaxType, /*bit*/
ObMaxType, /*EnumSet*/
ObMaxType, /*EnumSetInner*/
ObMaxType, /*OTimestamp*/
ObMaxType, /*Raw*/
ObMaxType, /*Interval*/
ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
},
{
/*Json -> XXX*/
ObJsonType, /*null*/
ObJsonType, /*int*/
ObJsonType, /*uint*/
ObJsonType, /*float*/
ObJsonType, /*double*/
ObJsonType, /*number*/
ObJsonType, /*datetime*/
ObJsonType, /*date*/
ObJsonType, /*time*/
ObJsonType, /*year*/
ObJsonType, /*string*/
ObMaxType, /*extend*/
ObJsonType, /*unknown*/
ObJsonType, /*text*/
ObJsonType, /*bit*/
ObJsonType, /*EnumSet*/
ObMaxType, /*EnumSetInner*/
ObJsonType, /*OTimestamp*/
ObMaxType, /*Raw*/
ObMaxType, /*Interval*/
ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObJsonType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
},
{
/*Geometry -> XXX*/
ObMaxType, /*null*/
ObMaxType, /*int*/
ObMaxType, /*uint*/
ObMaxType, /*float*/
ObMaxType, /*double*/
ObMaxType, /*number*/
ObMaxType, /*datetime*/
ObMaxType, /*date*/
ObMaxType, /*time*/
ObMaxType, /*year*/
ObMaxType, /*string*/
ObMaxType, /*extend*/
ObMaxType, /*unknown*/
ObMaxType, /*text*/
ObMaxType, /*bit*/
ObMaxType, /*EnumSet*/
ObMaxType, /*EnumSetInner*/
ObMaxType, /*OTimestamp*/
ObMaxType, /*Raw*/
ObMaxType, /*Interval*/
ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObMaxType, /*User Defined Type*/
},
{
/*User Defined Type -> XXX*/
ObMaxType, /*null*/
ObMaxType, /*int*/
ObMaxType, /*uint*/
ObMaxType, /*float*/
ObMaxType, /*double*/
ObMaxType, /*number*/
ObMaxType, /*datetime*/
ObMaxType, /*date*/
ObMaxType, /*time*/
ObMaxType, /*year*/
ObUserDefinedSQLType, /*string*/
ObUserDefinedSQLType, /*extend*/
ObMaxType, /*unknown*/
ObMaxType, /*text*/
ObMaxType, /*bit*/
ObMaxType, /*EnumSet*/
ObMaxType, /*EnumSetInner*/
ObMaxType, /*OTimestamp*/
ObMaxType, /*Raw*/
ObMaxType, /*Interval*/
ObMaxType, /*RowID*/
ObMaxType, /*Lob*/
ObMaxType, /*Json*/
ObMaxType, /*Geometry*/
ObUserDefinedSQLType, /*User Defined Type*/
}, },
}; };