Prohibit implicit conversion of UInt64-Field to DateTime64

This commit is contained in:
Vasily Nemkov 2019-10-08 10:01:17 +03:00
parent 1a84580005
commit 8792738944

View File

@ -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)
{