[CP] Add static array initialization compile-time checks in SQL expression module

This commit is contained in:
obdev
2024-02-23 04:48:06 +00:00
committed by ob-robot
parent 8b1bb126af
commit d5d96db4ec
13 changed files with 182 additions and 30 deletions

View File

@ -1,4 +1,4 @@
static ObObjType ABS_RESULT_TYPE[ObMaxType] = static constexpr ObObjType ABS_RESULT_TYPE[ObMaxType] =
{ {
ObDoubleType, /* NullType */ ObDoubleType, /* NullType */
ObIntType, /* TinyIntType */ ObIntType, /* TinyIntType */
@ -53,10 +53,8 @@ static ObObjType ABS_RESULT_TYPE[ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}; };
static_assert(sizeof(ABS_RESULT_TYPE) / sizeof(ObObjType) == ObMaxType,
"unexpected size of ABS_RESULT_TYPE");
static ObObjType ABS_RESULT_TYPE_ORACLE[ObMaxType] = static constexpr ObObjType ABS_RESULT_TYPE_ORACLE[ObMaxType] =
{ {
ObNullType, /* NullType */ ObNullType, /* NullType */
ObNumberType, /* TinyIntType */ ObNumberType, /* TinyIntType */
@ -111,5 +109,5 @@ static ObObjType ABS_RESULT_TYPE_ORACLE[ObMaxType] =
ObNumberType, /* ObDecimalIntType */ ObNumberType, /* ObDecimalIntType */
}; };
static_assert(sizeof(ABS_RESULT_TYPE_ORACLE) / sizeof(ObObjType) == ObMaxType, static_assert(is_array_fully_initialized(ABS_RESULT_TYPE_ORACLE), "ABS_RESULT_TYPE_ORACLE is partially initlized");
"unexpected size of ABS_RESULT_TYPE_ORACLE"); static_assert(is_array_fully_initialized(ABS_RESULT_TYPE), "ABS_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType ARITH_RESULT_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType ARITH_RESULT_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -1358,6 +1358,10 @@ static ObObjType ARITH_RESULT_TYPE[ObMaxType][ObMaxType] =
ObDoubleType, /* ObSetType */ ObDoubleType, /* ObSetType */
ObMaxType, /* ObEnumInnerType */ ObMaxType, /* ObEnumInnerType */
ObMaxType, /* ObSetInnerType */ ObMaxType, /* ObSetInnerType */
ObMaxType, /* ObTimestampTZType */
ObMaxType, /* ObTimestampLTZType */
ObMaxType, /* ObTimestampNanoType */
ObMaxType, /* ObRawType */
ObMaxType, /* ObIntervalYMType */ ObMaxType, /* ObIntervalYMType */
ObMaxType, /* ObIntervalDSType */ ObMaxType, /* ObIntervalDSType */
ObMaxType, /* ObNumberFloatType */ ObMaxType, /* ObNumberFloatType */
@ -2777,3 +2781,5 @@ static ObObjType ARITH_RESULT_TYPE[ObMaxType][ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
}; };
static_assert(is_array_fully_initialized(ARITH_RESULT_TYPE, ObMaxType), "ARITH_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType DIV_RESULT_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType DIV_RESULT_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -2781,3 +2781,5 @@ static ObObjType DIV_RESULT_TYPE[ObMaxType][ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
}; };
static_assert(is_array_fully_initialized(DIV_RESULT_TYPE, ObMaxType), "DIV_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType INT_DIV_RESULT_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType INT_DIV_RESULT_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -1141,9 +1141,9 @@ static ObObjType INT_DIV_RESULT_TYPE[ObMaxType][ObMaxType] =
ObIntType, /* ObTimestampTZType */ ObIntType, /* ObTimestampTZType */
ObIntType, /* ObTimestampLTZType */ ObIntType, /* ObTimestampLTZType */
ObIntType, /* ObTimestampNanoType */ ObIntType, /* ObTimestampNanoType */
ObIntType, /* ObRawType */
ObMaxType, /*ObIntervalYMType */ ObMaxType, /*ObIntervalYMType */
ObMaxType, /*ObIntervalDSType */ ObMaxType, /*ObIntervalDSType */
ObIntType, /* ObRawType */
ObMaxType, /* ObNumberFloatType */ ObMaxType, /* ObNumberFloatType */
ObMaxType, /* ObNVarchar2Type */ ObMaxType, /* ObNVarchar2Type */
ObMaxType, /* ObNCharType */ ObMaxType, /* ObNCharType */
@ -2782,3 +2782,5 @@ static ObObjType INT_DIV_RESULT_TYPE[ObMaxType][ObMaxType] =
ObIntType, /* ObDecimalIntType */ ObIntType, /* ObDecimalIntType */
} }
}; };
static_assert(is_array_fully_initialized(INT_DIV_RESULT_TYPE, ObMaxType), "INT_DIV_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = { static constexpr ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
/*NullType*/ /*NullType*/
{ {
ObNullType, /*NullType=>NullType */ ObNullType, /*NullType=>NullType */
@ -2784,7 +2784,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
} }
}; };
static ObObjType MERGE_RESULT_TYPE_ORACLE[ObMaxType][ObMaxType] = { static constexpr ObObjType MERGE_RESULT_TYPE_ORACLE[ObMaxType][ObMaxType] = {
/*NullType*/ /*NullType*/
{ {
ObNullType, /*NullType=>NullType */ ObNullType, /*NullType=>NullType */
@ -5569,3 +5569,6 @@ static ObObjType MERGE_RESULT_TYPE_ORACLE[ObMaxType][ObMaxType] = {
ObNumberType, /*ObDecimalIntType=>ObDecimalIntType */ ObNumberType, /*ObDecimalIntType=>ObDecimalIntType */
}, },
}; };
static_assert(is_array_fully_initialized(MERGE_RESULT_TYPE_ORACLE, ObMaxType), "MERGE_RESULT_TYPE_ORACLE is partially initlized");
static_assert(is_array_fully_initialized(MERGE_RESULT_TYPE, ObMaxType), "MERGE_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType MOD_RESULT_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType MOD_RESULT_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -2783,3 +2783,5 @@ static ObObjType MOD_RESULT_TYPE[ObMaxType][ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
}; };
static_assert(is_array_fully_initialized(MOD_RESULT_TYPE, ObMaxType), "MOD_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType NEG_RESULT_TYPE[ObMaxType] = static constexpr ObObjType NEG_RESULT_TYPE[ObMaxType] =
{ {
ObDoubleType, /*NullType */ ObDoubleType, /*NullType */
ObIntType, /*TinyIntType */ ObIntType, /*TinyIntType */
@ -53,7 +53,7 @@ static ObObjType NEG_RESULT_TYPE[ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}; };
static ObObjType NEG_RESULT_TYPE_ORACLE[ObMaxType] = static constexpr ObObjType NEG_RESULT_TYPE_ORACLE[ObMaxType] =
{ {
ObNumberType, /*NullType */ ObNumberType, /*NullType */
ObNumberType, /*TinyIntType */ ObNumberType, /*TinyIntType */
@ -107,3 +107,6 @@ static ObObjType NEG_RESULT_TYPE_ORACLE[ObMaxType] =
ObMaxType, /* ObUserDefinedSQLType */ ObMaxType, /* ObUserDefinedSQLType */
ObNumberType, /* ObDecimalIntType */ ObNumberType, /* ObDecimalIntType */
}; };
static_assert(is_array_fully_initialized(NEG_RESULT_TYPE_ORACLE), "NEG_RESULT_TYPE_ORACLE is partially initlized");
static_assert(is_array_fully_initialized(NEG_RESULT_TYPE), "NEG_RESULT_TYPE is partially initlized");

View File

@ -16,7 +16,7 @@ Item_result item_cmp_type(Item_result a,Item_result b)
} }
*/ */
static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -217,7 +217,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObNumberType, /*MediumTextType*/ ObNumberType, /*MediumTextType*/
ObNumberType, /*LongTextType*/ ObNumberType, /*LongTextType*/
ObNumberType, /*BitType*/ ObNumberType, /*BitType*/
ObNumberType, /*EnumSetType*/ ObNumberType, /*EnumType*/
ObNumberType, /*SetType*/ ObNumberType, /*SetType*/
ObNumberType, /*EnumInnerType*/ ObNumberType, /*EnumInnerType*/
ObNumberType, /*SetInnerType*/ ObNumberType, /*SetInnerType*/
@ -1558,7 +1558,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* UDT */ ObMaxType, /* UDT */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*TextType*/ /*TextType*/
{ {
ObMediumTextType, /* NullType */ ObMediumTextType, /* NullType */
ObNumberType, /* TinyIntType */ ObNumberType, /* TinyIntType */
@ -2527,10 +2527,11 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObNullType, /* ObNVarchar2Type */ ObNullType, /* ObNVarchar2Type */
ObNullType, /* ObNCharType */ ObNullType, /* ObNCharType */
ObNullType, /* ObURowIDType */ ObNullType, /* ObURowIDType */
ObNullType, /* ObLobType */
ObNullType, /* ObJsonType */ ObNullType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* UDT */ ObMaxType, /* UDT */
ObNullType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObLobType*/ /*ObLobType*/
{ {
@ -2584,7 +2585,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObNullType, /* ObJsonType */ ObNullType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* UDT */ ObMaxType, /* UDT */
ObNullType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObJsonType*/ /*ObJsonType*/
{ {
@ -2806,7 +2807,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
static ObObjType ORACLE_RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType ORACLE_RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -3007,7 +3008,7 @@ static ObObjType ORACLE_RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObNumberType, /*MediumTextType*/ ObNumberType, /*MediumTextType*/
ObNumberType, /*LongTextType*/ ObNumberType, /*LongTextType*/
ObNumberType, /*BitType*/ ObNumberType, /*BitType*/
ObNumberType, /*EnumSetType*/ ObNumberType, /*EnumType*/
ObNumberType, /*SetType*/ ObNumberType, /*SetType*/
ObNumberType, /*EnumInnerType*/ ObNumberType, /*EnumInnerType*/
ObNumberType, /*SetInnerType*/ ObNumberType, /*SetInnerType*/
@ -4348,7 +4349,7 @@ static ObObjType ORACLE_RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* UDT */ ObMaxType, /* UDT */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*TextType*/ /*TextType*/
{ {
ObMediumTextType, /* NullType */ ObMediumTextType, /* NullType */
ObNumberType, /* TinyIntType */ ObNumberType, /* TinyIntType */
@ -5595,3 +5596,6 @@ static ObObjType ORACLE_RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
}; };
//static_assert(is_array_fully_initialized(ORACLE_RELATIONAL_CMP_TYPE, ObMaxType), "ORACLE_RELATIONAL_CMP_TYPE is partially initlized");
static_assert(is_array_fully_initialized(RELATIONAL_CMP_TYPE, ObMaxType), "RELATIONAL_CMP_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -51,6 +51,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
@ -105,6 +106,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -159,6 +161,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -213,6 +216,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -267,6 +271,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -321,6 +326,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*UTinyIntType*/ /*UTinyIntType*/
@ -374,6 +380,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -428,6 +435,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -482,6 +490,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -536,6 +545,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -590,6 +600,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -644,6 +655,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDoubleType, /* ObDecimalIntType */ ObDoubleType, /* ObDecimalIntType */
}, },
@ -698,6 +710,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDoubleType, /* ObDecimalIntType */ ObDoubleType, /* ObDecimalIntType */
}, },
@ -752,6 +765,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDoubleType, /* ObDecimalIntType */ ObDoubleType, /* ObDecimalIntType */
}, },
@ -806,6 +820,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDoubleType, /* ObDecimalIntType */ ObDoubleType, /* ObDecimalIntType */
}, },
@ -860,6 +875,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObNumberType, /* ObGeometryType */ ObNumberType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObNumberType, /* ObDecimalIntType */ ObNumberType, /* ObDecimalIntType */
}, },
@ -914,6 +930,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObNumberType, /* ObGeometryType */ ObNumberType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObNumberType, /* ObDecimalIntType */ ObNumberType, /* ObDecimalIntType */
}, },
@ -968,6 +985,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDateTimeType, /* ObDecimalIntType */ ObDateTimeType, /* ObDecimalIntType */
}, },
@ -1022,6 +1040,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObTimestampType, /* ObDecimalIntType */ ObTimestampType, /* ObDecimalIntType */
}, },
@ -1076,6 +1095,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDateType, /* ObDecimalIntType */ ObDateType, /* ObDecimalIntType */
}, },
@ -1130,6 +1150,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObHexStringType, /* ObGeometryType */ ObHexStringType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObTimeType, /* ObDecimalIntType */ ObTimeType, /* ObDecimalIntType */
}, },
@ -1184,6 +1205,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType*/ ObDoubleType, /* ObGeometryType*/
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -1238,6 +1260,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObHexStringType, /* ObGeometryType */ ObHexStringType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -1292,6 +1315,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObHexStringType, /* ObGeometryType */ ObHexStringType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -1346,6 +1370,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObHexStringType, /* ObGeometryType */ ObHexStringType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -1400,6 +1425,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
@ -1454,6 +1480,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*TinyTextType*/ /*TinyTextType*/
@ -1507,6 +1534,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*TextType*/ /*TextType*/
@ -1560,6 +1588,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*MediumTextType*/ /*MediumTextType*/
@ -1613,6 +1642,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*LongTextType*/ /*LongTextType*/
@ -1666,6 +1696,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*BitType*/ /*BitType*/
@ -1705,7 +1736,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /*EnumType*/ ObMaxType, /*EnumType*/
ObMaxType, /*SetType*/ ObMaxType, /*SetType*/
ObMaxType, /*EnumInnerType*/ ObMaxType, /*EnumInnerType*/
ObMaxType, /*EnumInnerType*/ ObMaxType, /*SetInnerType*/
ObTimestampTZType, /* ObTimestampTZType */ ObTimestampTZType, /* ObTimestampTZType */
ObTimestampLTZType, /* ObTimestampLTZType */ ObTimestampLTZType, /* ObTimestampLTZType */
ObTimestampNanoType, /* ObTimestampNanoType */ ObTimestampNanoType, /* ObTimestampNanoType */
@ -1719,6 +1750,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*EnumType*/ /*EnumType*/
@ -1757,7 +1789,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObNumberType, /*BitType*/ ObNumberType, /*BitType*/
ObMaxType, /*EnumType*/ ObMaxType, /*EnumType*/
ObMaxType, /*SetType*/ ObMaxType, /*SetType*/
ObMaxType, /*EnumSetInnerType*/ ObMaxType, /*EnumInnerType*/
ObMaxType, /*SetInnerType*/ ObMaxType, /*SetInnerType*/
ObTimestampTZType, /* ObTimestampTZType */ ObTimestampTZType, /* ObTimestampTZType */
ObTimestampLTZType, /* ObTimestampLTZType */ ObTimestampLTZType, /* ObTimestampLTZType */
@ -1772,6 +1804,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObNumberType, /* ObJsonType */ ObNumberType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*SetType*/ /*SetType*/
@ -1810,7 +1843,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObNumberType, /*BitType*/ ObNumberType, /*BitType*/
ObMaxType, /*EnumType*/ ObMaxType, /*EnumType*/
ObMaxType, /*SetType*/ ObMaxType, /*SetType*/
ObMaxType, /*EnumSetInnerType*/ ObMaxType, /*EnumInnerType*/
ObMaxType, /*SetInnerType*/ ObMaxType, /*SetInnerType*/
ObTimestampTZType, /* ObTimestampTZType */ ObTimestampTZType, /* ObTimestampTZType */
ObTimestampLTZType, /* ObTimestampLTZType */ ObTimestampLTZType, /* ObTimestampLTZType */
@ -1825,6 +1858,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObNumberType, /* ObJsonType */ ObNumberType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*EnumInnerType*/ /*EnumInnerType*/
@ -1878,6 +1912,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObNumberType, /* ObJsonType */ ObNumberType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*SetInnerType*/ /*SetInnerType*/
@ -1931,6 +1966,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObNumberType, /* ObJsonType */ ObNumberType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObTimestampTZType*/ /*ObTimestampTZType*/
@ -1984,6 +2020,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObTimestampTZType, /* ObJsonType */ ObTimestampTZType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObTimestampTZType, /* ObDecimalIntType */ ObTimestampTZType, /* ObDecimalIntType */
}, },
/*ObTimestampLTZType*/ /*ObTimestampLTZType*/
@ -2037,6 +2074,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObTimestampLTZType, /* ObJsonType */ ObTimestampLTZType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObTimestampLTZType, /* ObDecimalIntType */ ObTimestampLTZType, /* ObDecimalIntType */
}, },
/*ObTimestampNanoType*/ /*ObTimestampNanoType*/
@ -2090,6 +2128,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObTimestampNanoType, /* ObJsonType */ ObTimestampNanoType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObTimestampNanoType, /* ObDecimalIntType */ ObTimestampNanoType, /* ObDecimalIntType */
}, },
/*ObRawType*/ /*ObRawType*/
@ -2143,6 +2182,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObVarcharType, /* ObJsonType */ ObVarcharType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObRawType, /* ObDecimalIntType */ ObRawType, /* ObDecimalIntType */
}, },
/*ObIntervalYMType*/ /*ObIntervalYMType*/
@ -2196,6 +2236,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObIntervalYMType, /* ObDecimalIntType */ ObIntervalYMType, /* ObDecimalIntType */
}, },
/*ObIntervalDSType*/ /*ObIntervalDSType*/
@ -2249,6 +2290,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObIntervalDSType, /* ObDecimalIntType */ ObIntervalDSType, /* ObDecimalIntType */
}, },
@ -2303,6 +2345,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObDoubleType, /* ObGeometryType */ ObDoubleType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObNumberType, /* ObDecimalIntType */ ObNumberType, /* ObDecimalIntType */
}, },
@ -2357,6 +2400,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
@ -2411,6 +2455,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
/*ObURowIDType*/ /*ObURowIDType*/
@ -2461,8 +2506,10 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObNVarchar2Type */ ObMaxType, /* ObNVarchar2Type */
ObMaxType, /* ObNCharType */ ObMaxType, /* ObNCharType */
ObMaxType, /* ObURowIDType */ ObMaxType, /* ObURowIDType */
ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObLobType*/ /*ObLobType*/
@ -2513,8 +2560,10 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObNVarchar2Type */ ObMaxType, /* ObNVarchar2Type */
ObMaxType, /* ObNCharType */ ObMaxType, /* ObNCharType */
ObMaxType, /* ObURowIDType */ ObMaxType, /* ObURowIDType */
ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObJsonType*/ /*ObJsonType*/
@ -2568,6 +2617,7 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObJsonType, /* ObGeometryType*/ ObJsonType, /* ObGeometryType*/
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObGeometryType*/ /*ObGeometryType*/
@ -2621,8 +2671,63 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObJsonType, /* ObJsonType */ ObJsonType, /* ObJsonType */
ObHexStringType, /* ObGeometryType */ ObHexStringType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */ ObMaxType, /* ObDecimalIntType */
}, },
/*ObUserDefinedSQLType*/
{
ObMaxType, /* NullType */
ObMaxType, /* TinyIntType */
ObMaxType, /* SmallIntType */
ObMaxType, /* MediumIntType */
ObMaxType, /* Int32Type */
ObMaxType, /* IntType */
ObMaxType, /* UTinyIntType */
ObMaxType, /* USmallIntType */
ObMaxType, /* UMediumIntType */
ObMaxType, /* UInt32Type */
ObMaxType, /* UIntType */
ObMaxType, /* FloatType */
ObMaxType, /* DoubleType */
ObMaxType, /* UFloatType */
ObMaxType, /* UDoubleType */
ObMaxType, /* NumberType */
ObMaxType, /* UNumberType */
ObMaxType, /* DateTimeType */
ObMaxType, /* TimestampType */
ObMaxType, /* DateType */
ObMaxType, /* TimeType */
ObMaxType, /* YearType */
ObMaxType, /* VarcharType */
ObMaxType, /* CharType */
ObMaxType, /* HexStringType */
ObMaxType, /* ExtendType */
ObMaxType, /* UnknownType */
ObMaxType, /*TinyTextType*/
ObMaxType, /*TextType*/
ObMaxType, /*MediumTextType*/
ObMaxType, /*LongTextType*/
ObMaxType, /*BitType*/
ObMaxType, /*EnumType*/
ObMaxType, /*SetType*/
ObMaxType, /*EnumInnerType*/
ObMaxType, /*SetInnerType*/
ObMaxType, /* ObTimestampTZType */
ObMaxType, /* ObTimestampLTZType */
ObMaxType, /* ObTimestampNanoType */
ObMaxType, /* ObRawType */
ObMaxType, /* ObIntervalYMType */
ObMaxType, /* ObIntervalDSType */
ObMaxType, /* ObNumberFloatType */
ObMaxType, /* ObNVarchar2Type */
ObMaxType, /* ObNCharType */
ObMaxType, /* ObURowIDType */
ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */
},
/*DecimalIntType*/ /*DecimalIntType*/
{ {
ObMaxType, /* NullType */ ObMaxType, /* NullType */
@ -2674,9 +2779,11 @@ static ObObjType RELATIONAL_EQUAL_TYPE[ObMaxType][ObMaxType] =
ObMaxType, /* ObLobType */ ObMaxType, /* ObLobType */
ObMaxType, /* ObJsonType */ ObMaxType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
}; };
static_assert(is_array_fully_initialized(RELATIONAL_EQUAL_TYPE, ObMaxType), "RELATIONAL_EQUAL_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType RELATIONAL_RESULT_TYPE[ObMaxType][ObMaxType] = static constexpr ObObjType RELATIONAL_RESULT_TYPE[ObMaxType][ObMaxType] =
{ {
/*NullType*/ /*NullType*/
{ {
@ -2782,3 +2782,5 @@ static ObObjType RELATIONAL_RESULT_TYPE[ObMaxType][ObMaxType] =
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}, },
}; };
static_assert(is_array_fully_initialized(RELATIONAL_RESULT_TYPE, ObMaxType), "RELATIONAL_RESULT_TYPE is partially initlized");

View File

@ -21,6 +21,24 @@
namespace oceanbase namespace oceanbase
{ {
using namespace common; using namespace common;
//Since ob use c++11, so we can not use loop or constains multiple return in constexpr function(which is supported in c++14)
//So we use recursion and conditional assignment statement instead
template <typename T, std::size_t row, std::size_t col>
constexpr bool is_array_fully_initialized(const T (&arr)[row][col], int row_depth)
{
return row_depth == 0 ?
true :
arr[row_depth - 1][col - 1] == T() ? false :
is_array_fully_initialized(arr, row_depth - 1);
}
template <typename T, std::size_t col>
constexpr bool is_array_fully_initialized(const T (&arr)[col])
{
return arr[col - 1] != T();
}
// following .map file depends on ns oceanbase::common; // following .map file depends on ns oceanbase::common;
#include "sql/engine/expr/ob_expr_merge_result_type_oracle.map" #include "sql/engine/expr/ob_expr_merge_result_type_oracle.map"
#include "sql/engine/expr/ob_expr_relational_result_type.map" #include "sql/engine/expr/ob_expr_relational_result_type.map"

View File

@ -1,4 +1,4 @@
static ObObjType ROUND_RESULT_TYPE[ObMaxType] = static constexpr ObObjType ROUND_RESULT_TYPE[ObMaxType] =
{ {
ObDoubleType, /* NullType */ ObDoubleType, /* NullType */
ObIntType, /* TinyIntType */ ObIntType, /* TinyIntType */
@ -52,3 +52,5 @@ static ObObjType ROUND_RESULT_TYPE[ObMaxType] =
ObMaxType, /* ObUserDefinedSQLType */ ObMaxType, /* ObUserDefinedSQLType */
ObDecimalIntType, /* ObDecimalIntType */ ObDecimalIntType, /* ObDecimalIntType */
}; };
static_assert(is_array_fully_initialized(ROUND_RESULT_TYPE), "ROUND_RESULT_TYPE is partially initlized");

View File

@ -1,4 +1,4 @@
static ObObjType SUM_RESULT_TYPE[ObMaxType] = static constexpr ObObjType SUM_RESULT_TYPE[ObMaxType] =
{ {
ObDoubleType, /*NullType */ ObDoubleType, /*NullType */
ObNumberType, /*TinyIntType */ ObNumberType, /*TinyIntType */
@ -50,4 +50,7 @@ static ObObjType SUM_RESULT_TYPE[ObMaxType] =
ObDoubleType, /* ObJsonType */ ObDoubleType, /* ObJsonType */
ObMaxType, /* ObGeometryType */ ObMaxType, /* ObGeometryType */
ObMaxType, /* ObUserDefinedSQLType */ ObMaxType, /* ObUserDefinedSQLType */
ObMaxType, /* ObDecimalIntType */
}; };
static_assert(is_array_fully_initialized(SUM_RESULT_TYPE), "SUM_RESULT_TYPE is partially initlized");