diff --git a/dbms/src/Interpreters/convertFieldToType.cpp b/dbms/src/Interpreters/convertFieldToType.cpp index 1fed7bb712f..52320339a8a 100644 --- a/dbms/src/Interpreters/convertFieldToType.cpp +++ b/dbms/src/Interpreters/convertFieldToType.cpp @@ -208,11 +208,12 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID return dynamic_cast(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) {