Skip to content

Commit 8bf545b

Browse files
committed
MDEV-25080 Fix a corner case in DataConvert::joinColTypeForUnion().
1 parent 95a314f commit 8bf545b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/dataconvert/dataconvert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,7 @@ void DataConvert::joinColTypeForUnion(datatypes::SystemCatalog::TypeHolderStd& u
29752975
case datatypes::SystemCatalog::UBIGINT:
29762976
case datatypes::SystemCatalog::UDECIMAL:
29772977

2978-
if (type.scale != 0 && unionedType.scale != 0)
2978+
if (type.scale != 0 && (unionedType.scale != 0 || isDecimal(unionedType.colDataType)))
29792979
{
29802980
const unsigned int digitsBeforeDecimal = type.precision - type.scale;
29812981
const unsigned int digitsBeforeDecimalUnion = unionedType.precision - unionedType.scale;

0 commit comments

Comments
 (0)