Fixed parsing DateTime64 as unix timestamp with subsecond precision scaled to integer.

e.g. toDateTime64('1111111111222', 3)
This commit is contained in:
Vasily Nemkov 2021-04-11 17:28:58 +03:00
parent c882d290bd
commit 0f7c83b5ac

View File

@ -774,7 +774,7 @@ inline ReturnType readDateTimeTextImpl(DateTime64 & datetime64, UInt32 scale, Re
++buf.position();
}
//9908870400 is time_t value for 2084-01-01 UTC (a bit over the last year supported by DateTime64)
else if (scale && scale < 18 && (whole >= 9908870400LL * static_cast<int64_t>(intExp10(scale))))
else if (whole >= 9908870400LL)
{
/// Unix timestamp with subsecond precision, already scaled to integer.
/// For disambiguation we support only time since 2001-09-09 01:46:40 UTC and less than 30 000 years in future.