diff --git a/src/Interpreters/convertFieldToType.cpp b/src/Interpreters/convertFieldToType.cpp index 79f41d77526..dd23ad69ae2 100644 --- a/src/Interpreters/convertFieldToType.cpp +++ b/src/Interpreters/convertFieldToType.cpp @@ -193,6 +193,7 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID if (const auto * ptype = typeid_cast *>(&type)) return convertDecimalType(src, *ptype); if (const auto * ptype = typeid_cast *>(&type)) return convertDecimalType(src, *ptype); if (const auto * ptype = typeid_cast *>(&type)) return convertDecimalType(src, *ptype); + if (const auto * ptype = typeid_cast *>(&type)) return convertDecimalType(src, *ptype); if (which_type.isEnum() && (src.getType() == Field::Types::UInt64 || src.getType() == Field::Types::Int64)) { diff --git a/tests/queries/0_stateless/02286_convert_decimal_type.reference b/tests/queries/0_stateless/02286_convert_decimal_type.reference new file mode 100644 index 00000000000..94ebaf90016 --- /dev/null +++ b/tests/queries/0_stateless/02286_convert_decimal_type.reference @@ -0,0 +1,4 @@ +1 +2 +3 +4 diff --git a/tests/queries/0_stateless/02286_convert_decimal_type.sql b/tests/queries/0_stateless/02286_convert_decimal_type.sql new file mode 100644 index 00000000000..ffc4c176939 --- /dev/null +++ b/tests/queries/0_stateless/02286_convert_decimal_type.sql @@ -0,0 +1,4 @@ +SELECT * FROM VALUES('x Decimal32(0)', (1)); +SELECT * FROM VALUES('x Decimal64(0)', (2)); +SELECT * FROM VALUES('x Decimal128(0)', (3)); +SELECT * FROM VALUES('x Decimal256(0)', (4));