mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 19:42:00 +00:00
Update GregorianDate.h
This commit is contained in:
parent
b0dd95447d
commit
898c935d31
@ -328,17 +328,16 @@ namespace DB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename YearT>
|
|
||||||
template <is_integer TDay>
|
template <is_integer TDay>
|
||||||
OrdinalDate<YearT>::OrdinalDate(TDay modified_julian_day)
|
OrdinalDate<YearT>::OrdinalDate(TDay modified_julian_day)
|
||||||
{
|
{
|
||||||
/// This function supports day number from -678941 to 2973119 (which represent 0000-01-01 and 9999-12-31 respectively).
|
/// This function supports day number from -678941 to 2973119 (which represent 0000-01-01 and 9999-12-31 respectively).
|
||||||
|
|
||||||
if constexpr (is_signed_v<decltype(modified_julian_day)> && std::numeric_limits<decltype(modified_julian_day)>::lowest() < -678941)
|
if constexpr (is_signed_v<TDay> && std::numeric_limits<TDay>::lowest() < -678941)
|
||||||
if (modified_julian_day < -678941)
|
if (modified_julian_day < -678941)
|
||||||
modified_julian_day = -678941;
|
modified_julian_day = -678941;
|
||||||
|
|
||||||
if constexpr (std::numeric_limits<decltype(modified_julian_day)>::max() > 2973119)
|
if constexpr (std::numeric_limits<TDay>::max() > 2973119)
|
||||||
if (modified_julian_day > 2973119)
|
if (modified_julian_day > 2973119)
|
||||||
modified_julian_day = 2973119;
|
modified_julian_day = 2973119;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user