Fix error

This commit is contained in:
Alexey Milovidov 2022-09-19 09:30:48 +02:00
parent b87d12494e
commit 000b6ac81c
3 changed files with 5 additions and 6 deletions

View File

@ -244,7 +244,7 @@ private:
static inline LUTIndex toLUTIndex(ExtendedDayNum d)
{
return normalizeLUTIndex(static_cast<UInt32>(d + daynum_offset_epoch));
return normalizeLUTIndex(static_cast<Int64>(d + daynum_offset_epoch));
}
inline LUTIndex toLUTIndex(Time t) const
@ -252,10 +252,9 @@ private:
return findIndex(t);
}
template <typename T>
static inline LUTIndex toLUTIndex(T i)
static inline LUTIndex toLUTIndex(LUTIndex i)
{
return LUTIndex(static_cast<UInt32>(i));
return i;
}
template <typename DateOrTime>

View File

@ -105,7 +105,7 @@ template <typename T>
void SerializationNumber<T>::serializeBinary(const Field & field, WriteBuffer & ostr) const
{
/// ColumnVector<T>::ValueType is a narrower type. For example, UInt8, when the Field type is UInt64
typename ColumnVector<T>::ValueType x = field.get<FieldType>();
typename ColumnVector<T>::ValueType x = static_cast<typename ColumnVector<T>::ValueType>(field.get<FieldType>());
writeBinary(x, ostr);
}

View File

@ -402,7 +402,7 @@ struct ToDateTransform32Or64Signed
return (from < DATE_LUT_MAX_DAY_NUM)
? from
: std::min<Int32>(Int32(time_zone.toDayNum(from)), Int32(0xFFFFFFFF));
: std::min<Int32>(Int32(time_zone.toDayNum(static_cast<UInt16>(from))), Int32(0xFFFFFFFF));
}
};