Make compatible with mysql bit type deduction for case_when expr

This commit is contained in:
obdev
2023-07-17 02:48:02 +00:00
committed by ob-robot
parent 214101d63f
commit cf39d8c8e3
2 changed files with 39 additions and 39 deletions

View File

@ -86,7 +86,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* TinyIntType=>ObTextType */ ObTextType, /* TinyIntType=>ObTextType */
ObMediumTextType, /* TinyIntType=>ObMediumTextType */ ObMediumTextType, /* TinyIntType=>ObMediumTextType */
ObLongTextType, /* TinyIntType=>ObLongTextType */ ObLongTextType, /* TinyIntType=>ObLongTextType */
ObVarcharType, /* TinyIntType=>ObBitType */ ObNumberType, /* TinyIntType=>ObBitType */
ObVarcharType, /* TinyIntType=>ObeEnumType */ ObVarcharType, /* TinyIntType=>ObeEnumType */
ObVarcharType, /* TinyIntType=>ObSetType */ ObVarcharType, /* TinyIntType=>ObSetType */
ObMaxType, /* TinyIntType=>ObEnumInnerType */ ObMaxType, /* TinyIntType=>ObEnumInnerType */
@ -140,7 +140,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* SmallIntType=>ObTextType */ ObTextType, /* SmallIntType=>ObTextType */
ObMediumTextType, /* SmallIntType=>ObMediumTextType */ ObMediumTextType, /* SmallIntType=>ObMediumTextType */
ObLongTextType, /* SmallIntType=>ObLongTextType */ ObLongTextType, /* SmallIntType=>ObLongTextType */
ObVarcharType, /* SmallIntType=>ObBitType */ ObNumberType, /* SmallIntType=>ObBitType */
ObVarcharType, /* SmallIntType=>ObEnumType */ ObVarcharType, /* SmallIntType=>ObEnumType */
ObVarcharType, /* SmallIntType=>ObSetType */ ObVarcharType, /* SmallIntType=>ObSetType */
ObMaxType, /* SmallIntType=>ObEnumInnerType */ ObMaxType, /* SmallIntType=>ObEnumInnerType */
@ -194,7 +194,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* MediumIntType=>ObTextType */ ObTextType, /* MediumIntType=>ObTextType */
ObMediumTextType, /* MediumIntType=>ObMediumTextType */ ObMediumTextType, /* MediumIntType=>ObMediumTextType */
ObLongTextType, /* MediumIntType=>ObLongTextType */ ObLongTextType, /* MediumIntType=>ObLongTextType */
ObVarcharType, /* MediumIntType=>ObBitType */ ObNumberType, /* MediumIntType=>ObBitType */
ObVarcharType, /* MediumIntType=>ObEnumType */ ObVarcharType, /* MediumIntType=>ObEnumType */
ObVarcharType, /* MediumIntType=>ObSetType */ ObVarcharType, /* MediumIntType=>ObSetType */
ObMaxType, /* MediumIntType=>ObEnumInnerType */ ObMaxType, /* MediumIntType=>ObEnumInnerType */
@ -248,7 +248,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* Int32Type=>ObTextType */ ObTextType, /* Int32Type=>ObTextType */
ObMediumTextType, /* Int32Type=>ObMediumTextType */ ObMediumTextType, /* Int32Type=>ObMediumTextType */
ObLongTextType, /* Int32Type=>ObLongTextType */ ObLongTextType, /* Int32Type=>ObLongTextType */
ObVarcharType, /* Int32Type=>ObBitType */ ObNumberType, /* Int32Type=>ObBitType */
ObVarcharType, /* Int32Type=>ObEnumType */ ObVarcharType, /* Int32Type=>ObEnumType */
ObVarcharType, /* Int32Type=>ObSetType */ ObVarcharType, /* Int32Type=>ObSetType */
ObMaxType, /* Int32Type=>ObEnumInnerType */ ObMaxType, /* Int32Type=>ObEnumInnerType */
@ -302,7 +302,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* IntType=>ObTextType */ ObTextType, /* IntType=>ObTextType */
ObMediumTextType, /* IntType=>ObMediumTextType */ ObMediumTextType, /* IntType=>ObMediumTextType */
ObLongTextType, /* IntType=>ObLongTextType */ ObLongTextType, /* IntType=>ObLongTextType */
ObVarcharType, /* IntType=>ObBitType */ ObNumberType, /* IntType=>ObBitType */
ObVarcharType, /* IntType=>ObEnumType */ ObVarcharType, /* IntType=>ObEnumType */
ObVarcharType, /* IntType=>ObSetType */ ObVarcharType, /* IntType=>ObSetType */
ObMaxType, /* IntType=>ObEnumInnerType */ ObMaxType, /* IntType=>ObEnumInnerType */
@ -356,7 +356,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UTinyIntType=>ObTextType */ ObTextType, /* UTinyIntType=>ObTextType */
ObMediumTextType, /* UTinyIntType=>ObMediumTextType */ ObMediumTextType, /* UTinyIntType=>ObMediumTextType */
ObLongTextType, /* UTinyIntType=>ObLongTextType */ ObLongTextType, /* UTinyIntType=>ObLongTextType */
ObVarcharType, /* UTinyIntType=>ObBitType */ ObUInt64Type, /* UTinyIntType=>ObBitType */
ObVarcharType, /* UTinyIntType=>ObEnumType */ ObVarcharType, /* UTinyIntType=>ObEnumType */
ObVarcharType, /* UTinyIntType=>ObSetType */ ObVarcharType, /* UTinyIntType=>ObSetType */
ObMaxType, /* UTinyIntType=>ObEnumInnerType */ ObMaxType, /* UTinyIntType=>ObEnumInnerType */
@ -410,7 +410,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* USmallIntType=>ObTextType */ ObTextType, /* USmallIntType=>ObTextType */
ObMediumTextType, /* USmallIntType=>ObMediumTextType */ ObMediumTextType, /* USmallIntType=>ObMediumTextType */
ObLongTextType, /* USmallIntType=>ObLongTextType */ ObLongTextType, /* USmallIntType=>ObLongTextType */
ObVarcharType, /* USmallIntType=>ObBitType */ ObUInt64Type, /* USmallIntType=>ObBitType */
ObVarcharType, /* USmallIntType=>ObEnumType */ ObVarcharType, /* USmallIntType=>ObEnumType */
ObVarcharType, /* USmallIntType=>ObSetType */ ObVarcharType, /* USmallIntType=>ObSetType */
ObMaxType, /* USmallIntType=>ObEnumInnerType */ ObMaxType, /* USmallIntType=>ObEnumInnerType */
@ -464,7 +464,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UMediumIntType=>ObTextType */ ObTextType, /* UMediumIntType=>ObTextType */
ObMediumTextType, /* UMediumIntType=>ObMediumTextType */ ObMediumTextType, /* UMediumIntType=>ObMediumTextType */
ObLongTextType, /* UMediumIntType=>ObLongTextType */ ObLongTextType, /* UMediumIntType=>ObLongTextType */
ObVarcharType, /* UMediumIntType=>ObBitType */ ObUInt64Type, /* UMediumIntType=>ObBitType */
ObVarcharType, /* UMediumIntType=>ObEnumType */ ObVarcharType, /* UMediumIntType=>ObEnumType */
ObVarcharType, /* UMediumIntType=>ObSetType */ ObVarcharType, /* UMediumIntType=>ObSetType */
ObMaxType, /* UMediumIntType=>ObEnumInnerType */ ObMaxType, /* UMediumIntType=>ObEnumInnerType */
@ -518,7 +518,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UInt32Type=>ObTextType */ ObTextType, /* UInt32Type=>ObTextType */
ObMediumTextType, /* UInt32Type=>ObMediumTextType */ ObMediumTextType, /* UInt32Type=>ObMediumTextType */
ObLongTextType, /* UInt32Type=>ObLongTextType */ ObLongTextType, /* UInt32Type=>ObLongTextType */
ObVarcharType, /* UInt32Type=>ObBitType */ ObUInt64Type, /* UInt32Type=>ObBitType */
ObVarcharType, /* UInt32Type=>ObEnumType */ ObVarcharType, /* UInt32Type=>ObEnumType */
ObVarcharType, /* UInt32Type=>ObSetType */ ObVarcharType, /* UInt32Type=>ObSetType */
ObMaxType, /* UInt32Type=>ObEnumInnerType */ ObMaxType, /* UInt32Type=>ObEnumInnerType */
@ -572,7 +572,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UIntType=>ObTextType */ ObTextType, /* UIntType=>ObTextType */
ObMediumTextType, /* UIntType=>ObMediumTextType */ ObMediumTextType, /* UIntType=>ObMediumTextType */
ObLongTextType, /* UIntType=>ObLongTextType */ ObLongTextType, /* UIntType=>ObLongTextType */
ObVarcharType, /* UIntType=>ObBitType */ ObUInt64Type, /* UIntType=>ObBitType */
ObVarcharType, /* UIntType=>ObEnumType */ ObVarcharType, /* UIntType=>ObEnumType */
ObVarcharType, /* UIntType=>ObSetType */ ObVarcharType, /* UIntType=>ObSetType */
ObMaxType, /* UIntType=>ObEnumInnerType */ ObMaxType, /* UIntType=>ObEnumInnerType */
@ -626,7 +626,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* FloatType=>ObTextType */ ObTextType, /* FloatType=>ObTextType */
ObMediumTextType, /* FloatType=>ObMediumTextType */ ObMediumTextType, /* FloatType=>ObMediumTextType */
ObLongTextType, /* FloatType=>ObLongTextType */ ObLongTextType, /* FloatType=>ObLongTextType */
ObVarcharType, /* FloatType=>ObBitType */ ObDoubleType, /* FloatType=>ObBitType */
ObVarcharType, /* FloatType=>ObEnumType */ ObVarcharType, /* FloatType=>ObEnumType */
ObVarcharType, /* FloatType=>ObSetType */ ObVarcharType, /* FloatType=>ObSetType */
ObMaxType, /* FloatType=>ObEnumInnerType */ ObMaxType, /* FloatType=>ObEnumInnerType */
@ -680,7 +680,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* DoubleType=>ObTextType */ ObTextType, /* DoubleType=>ObTextType */
ObMediumTextType, /* DoubleType=>ObMediumTextType */ ObMediumTextType, /* DoubleType=>ObMediumTextType */
ObLongTextType, /* DoubleType=>ObLongTextType */ ObLongTextType, /* DoubleType=>ObLongTextType */
ObVarcharType, /* DoubleType=>ObBitType */ ObDoubleType, /* DoubleType=>ObBitType */
ObVarcharType, /* DoubleType=>ObEnumType */ ObVarcharType, /* DoubleType=>ObEnumType */
ObVarcharType, /* DoubleType=>ObSetType */ ObVarcharType, /* DoubleType=>ObSetType */
ObMaxType, /* DoubleType=>ObEnumInnerType */ ObMaxType, /* DoubleType=>ObEnumInnerType */
@ -734,7 +734,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UFloatType=>ObTextType */ ObTextType, /* UFloatType=>ObTextType */
ObMediumTextType, /* UFloatType=>ObMediumTextType */ ObMediumTextType, /* UFloatType=>ObMediumTextType */
ObLongTextType, /* UFloatType=>ObLongTextType */ ObLongTextType, /* UFloatType=>ObLongTextType */
ObVarcharType, /* UFloatType=>ObBitType */ ObDoubleType, /* UFloatType=>ObBitType */
ObVarcharType, /* UFloatType=>ObEnumType */ ObVarcharType, /* UFloatType=>ObEnumType */
ObVarcharType, /* UFloatType=>ObSetType */ ObVarcharType, /* UFloatType=>ObSetType */
ObMaxType, /* UFloatType=>ObEnumInnerType */ ObMaxType, /* UFloatType=>ObEnumInnerType */
@ -788,7 +788,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UDoubleType=>ObTextType */ ObTextType, /* UDoubleType=>ObTextType */
ObMediumTextType, /* UDoubleType=>ObMediumTextType */ ObMediumTextType, /* UDoubleType=>ObMediumTextType */
ObLongTextType, /* UDoubleType=>ObLongTextType */ ObLongTextType, /* UDoubleType=>ObLongTextType */
ObVarcharType, /* UDoubleType=>ObBitType */ ObDoubleType, /* UDoubleType=>ObBitType */
ObVarcharType, /* UDoubleType=>ObEnumType */ ObVarcharType, /* UDoubleType=>ObEnumType */
ObVarcharType, /* UDoubleType=>ObSetType */ ObVarcharType, /* UDoubleType=>ObSetType */
ObMaxType, /* UDoubleType=>ObEnumInnerType */ ObMaxType, /* UDoubleType=>ObEnumInnerType */
@ -842,7 +842,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* NumberType=>ObTextType */ ObTextType, /* NumberType=>ObTextType */
ObMediumTextType, /* NumberType=>ObMediumTextType */ ObMediumTextType, /* NumberType=>ObMediumTextType */
ObLongTextType, /* NumberType=>ObLongTextType */ ObLongTextType, /* NumberType=>ObLongTextType */
ObVarcharType, /* NumberType=>ObBitType */ ObNumberType, /* NumberType=>ObBitType */
ObVarcharType, /* NumberType=>ObEnumType */ ObVarcharType, /* NumberType=>ObEnumType */
ObVarcharType, /* NumberType=>ObSetType */ ObVarcharType, /* NumberType=>ObSetType */
ObMaxType, /* NumberType=>ObEnumInnerType */ ObMaxType, /* NumberType=>ObEnumInnerType */
@ -896,7 +896,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* UNumberType=>ObTextType */ ObTextType, /* UNumberType=>ObTextType */
ObMediumTextType, /* UNumberType=>ObMediumTextType */ ObMediumTextType, /* UNumberType=>ObMediumTextType */
ObLongTextType, /* UNumberType=>ObLongTextType */ ObLongTextType, /* UNumberType=>ObLongTextType */
ObVarcharType, /* UNumberType=>ObBitType */ ObUNumberType, /* UNumberType=>ObBitType */
ObVarcharType, /* UNumberType=>ObEnumType */ ObVarcharType, /* UNumberType=>ObEnumType */
ObVarcharType, /* UNumberType=>ObSetType */ ObVarcharType, /* UNumberType=>ObSetType */
ObMaxType, /* UNumberType=>ObEnumInnerType */ ObMaxType, /* UNumberType=>ObEnumInnerType */
@ -1166,7 +1166,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObTextType, /* YearType=>ObTextType */ ObTextType, /* YearType=>ObTextType */
ObMediumTextType, /* YearType=>ObMediumTextType */ ObMediumTextType, /* YearType=>ObMediumTextType */
ObLongTextType, /* YearType=>ObLongTextType */ ObLongTextType, /* YearType=>ObLongTextType */
ObVarcharType, /* YearType=>ObBitType */ ObUInt64Type, /* YearType=>ObBitType */
ObVarcharType, /* YearType=>ObEnumType */ ObVarcharType, /* YearType=>ObEnumType */
ObVarcharType, /* YearType=>ObSetType */ ObVarcharType, /* YearType=>ObSetType */
ObMaxType, /* YearType=>ObEnumInnerType */ ObMaxType, /* YearType=>ObEnumInnerType */
@ -1274,7 +1274,7 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
ObLongTextType, /* CharType=>ObTextType */ ObLongTextType, /* CharType=>ObTextType */
ObLongTextType, /* CharType=>ObMediumTextType */ ObLongTextType, /* CharType=>ObMediumTextType */
ObLongTextType, /* CharType=>ObLongTextType */ ObLongTextType, /* CharType=>ObLongTextType */
ObCharType, /* CharType=>ObBitType */ ObVarcharType, /* CharType=>ObBitType */
ObCharType, /* CharType=>ObEnumType */ ObCharType, /* CharType=>ObEnumType */
ObCharType, /* CharType=>ObSetType */ ObCharType, /* CharType=>ObSetType */
ObMaxType, /* CharType=>ObEnumInnerType */ ObMaxType, /* CharType=>ObEnumInnerType */
@ -1672,29 +1672,29 @@ static ObObjType MERGE_RESULT_TYPE[ObMaxType][ObMaxType] = {
/*ObBitType*/ /*ObBitType*/
{ {
ObVarcharType, /*ObBitType=>NullType */ ObVarcharType, /*ObBitType=>NullType */
ObVarcharType, /*ObBitType=>TinyIntType */ ObNumberType, /*ObBitType=>TinyIntType */
ObVarcharType, /*ObBitType=>SmallIntType */ ObNumberType, /*ObBitType=>SmallIntType */
ObVarcharType, /*ObBitType=>MediumIntType */ ObNumberType, /*ObBitType=>MediumIntType */
ObVarcharType, /*ObBitType=>Int32Type */ ObNumberType, /*ObBitType=>Int32Type */
ObVarcharType, /*ObBitType=>IntType */ ObNumberType, /*ObBitType=>IntType */
ObVarcharType, /*ObBitType=>UTinyIntType */ ObUInt64Type, /*ObBitType=>UTinyIntType */
ObVarcharType, /*ObBitType=>USmallIntType */ ObUInt64Type, /*ObBitType=>USmallIntType */
ObVarcharType, /*ObBitType=>UMediumIntType */ ObUInt64Type, /*ObBitType=>UMediumIntType */
ObVarcharType, /*ObBitType=>UInt32Type */ ObUInt64Type, /*ObBitType=>UInt32Type */
ObVarcharType, /*ObBitType=>UIntType */ ObUInt64Type, /*ObBitType=>UIntType */
ObVarcharType, /*ObBitType=>FloatType */ ObDoubleType, /*ObBitType=>FloatType */
ObVarcharType, /*ObBitType=>DoubleType */ ObDoubleType, /*ObBitType=>DoubleType */
ObVarcharType, /*ObBitType=>UFloatType */ ObDoubleType, /*ObBitType=>UFloatType */
ObVarcharType, /*ObBitType=>UDoubleType */ ObDoubleType, /*ObBitType=>UDoubleType */
ObVarcharType, /*ObBitType=>NumberType */ ObNumberType, /*ObBitType=>NumberType */
ObVarcharType, /*ObBitType=>UNumberType */ ObUNumberType, /*ObBitType=>UNumberType */
ObVarcharType, /*ObBitType=>DateTimeType */ ObVarcharType, /*ObBitType=>DateTimeType */
ObVarcharType, /*ObBitType=>TimestampType */ ObVarcharType, /*ObBitType=>TimestampType */
ObVarcharType, /*ObBitType=>DateType */ ObVarcharType, /*ObBitType=>DateType */
ObVarcharType, /*ObBitType=>TimeType */ ObVarcharType, /*ObBitType=>TimeType */
ObVarcharType, /*ObBitType=>YearType */ ObUInt64Type, /*ObBitType=>YearType */
ObVarcharType, /*ObBitType=>VarcharType */ ObVarcharType, /*ObBitType=>VarcharType */
ObCharType, /*ObBitType=>CharType */ ObVarcharType, /*ObBitType=>CharType */
ObVarcharType, /*ObBitType=>HexStringType */ ObVarcharType, /*ObBitType=>HexStringType */
ObMaxType, /*ObBitType=>ExtendType */ ObMaxType, /*ObBitType=>ExtendType */
ObVarcharType, /*ObBitType=>UnknownType */ ObVarcharType, /*ObBitType=>UnknownType */

View File

@ -990,7 +990,7 @@ call proc_12976_a();
+-------------------------+--------------------+ +-------------------------+--------------------+
| coalesce(localvar, 1)+1 | coalesce(val, 1)+1 | | coalesce(localvar, 1)+1 | coalesce(val, 1)+1 |
+-------------------------+--------------------+ +-------------------------+--------------------+
| 1 | 1 | | 2 | 2 |
+-------------------------+--------------------+ +-------------------------+--------------------+
call proc_12976_b('A', @ep, @msg); call proc_12976_b('A', @ep, @msg);
+------+------+ +------+------+