mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
Prohibit implicit conversion of UInt64-Field to DateTime64
This commit is contained in:
parent
1a84580005
commit
8792738944
@ -208,11 +208,12 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID
|
||||
return dynamic_cast<const IDataTypeEnum &>(type).castToValue(src);
|
||||
}
|
||||
|
||||
if (which_type.isDateOrDateTime() && src.getType() == Field::Types::UInt64)
|
||||
if (which_type.isDateOrDateTime() && !which_type.isDateTime64() && src.getType() == Field::Types::UInt64)
|
||||
{
|
||||
/// We don't need any conversion UInt64 is under type of Date and DateTime
|
||||
return src;
|
||||
}
|
||||
// TODO (vnemkov): extra cases for DateTime64: converting from integer, converting from Decimal
|
||||
|
||||
if (src.getType() == Field::Types::String)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user