diff --git a/dbms/src/DataTypes/DataTypeDateTime.cpp b/dbms/src/DataTypes/DataTypeDateTime.cpp index 9bdce40b3a4..24215f3e590 100644 --- a/dbms/src/DataTypes/DataTypeDateTime.cpp +++ b/dbms/src/DataTypes/DataTypeDateTime.cpp @@ -159,7 +159,9 @@ void DataTypeDateTime::serializeProtobuf(const IColumn & column, size_t row_num, { if (value_index) return; - value_index = static_cast(protobuf.writeDateTime(assert_cast(assert_cast(column).getData()[row_num]))); + + // On some platforms `time_t` is `long` but not `unsigned int` (UInt32 that we store in column), hence static_cast. + value_index = static_cast(protobuf.writeDateTime(static_cast(assert_cast(column).getData()[row_num]))); } void DataTypeDateTime::deserializeProtobuf(IColumn & column, ProtobufReader & protobuf, bool allow_add_row, bool & row_added) const