mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #36489 from awakeljw/fork_chmaster
fix ConvertDecimalType unexpected behavior
This commit is contained in:
commit
2106a7b895
@ -193,6 +193,7 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID
|
||||
if (const auto * ptype = typeid_cast<const DataTypeDecimal<Decimal32> *>(&type)) return convertDecimalType(src, *ptype);
|
||||
if (const auto * ptype = typeid_cast<const DataTypeDecimal<Decimal64> *>(&type)) return convertDecimalType(src, *ptype);
|
||||
if (const auto * ptype = typeid_cast<const DataTypeDecimal<Decimal128> *>(&type)) return convertDecimalType(src, *ptype);
|
||||
if (const auto * ptype = typeid_cast<const DataTypeDecimal<Decimal256> *>(&type)) return convertDecimalType(src, *ptype);
|
||||
|
||||
if (which_type.isEnum() && (src.getType() == Field::Types::UInt64 || src.getType() == Field::Types::Int64))
|
||||
{
|
||||
|
@ -0,0 +1,4 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
4
tests/queries/0_stateless/02286_convert_decimal_type.sql
Normal file
4
tests/queries/0_stateless/02286_convert_decimal_type.sql
Normal file
@ -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));
|
Loading…
Reference in New Issue
Block a user