Fix assert in parseDateTimeBestEffort

This commit is contained in:
Alexey Milovidov 2020-08-02 05:05:47 +03:00
parent 9e97aab3b3
commit ace4533fae
3 changed files with 4 additions and 1 deletions

View File

@ -553,7 +553,7 @@ ReturnType parseDateTimeBestEffortImpl(
};
if (!check_date(is_leap_year, month, day_of_month))
return on_error("Cannot read DateTime: logical error, unexpected date: " + std::to_string(year) + "-" + std::to_string(month) + "-" + std::to_string(day_of_month), ErrorCodes::LOGICAL_ERROR);
return on_error("Cannot read DateTime: unexpected date: " + std::to_string(year) + "-" + std::to_string(month) + "-" + std::to_string(day_of_month), ErrorCodes::CANNOT_PARSE_DATETIME);
if (is_pm && hour < 12)
hour += 12;

View File

@ -0,0 +1,2 @@
select parseDateTime64BestEffort('2.55'); -- { serverError 41 }
select parseDateTime64BestEffortOrNull('2.55');