This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch dev-1.0.1 in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
commit 9f14de2127149d1cab53453cf98377ca6c386c1c Author: Gabriel <[email protected]> AuthorDate: Mon May 30 21:35:41 2022 +0800 [BUG] return NULL for invalid date value (#9862) --- be/src/vec/runtime/vdatetime_value.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/be/src/vec/runtime/vdatetime_value.cpp b/be/src/vec/runtime/vdatetime_value.cpp index ec40d27b00..97cec16e0f 100644 --- a/be/src/vec/runtime/vdatetime_value.cpp +++ b/be/src/vec/runtime/vdatetime_value.cpp @@ -61,11 +61,11 @@ bool VecDateTimeValue::check_range(uint32_t year, uint32_t month, uint32_t day, } bool VecDateTimeValue::check_date(uint32_t year, uint32_t month, uint32_t day) { - if (month != 0 && month <= 12 && day > s_days_in_month[month]) { - // Feb 29 in leap year is valid. - if (!(month == 2 && day == 29 && is_leap(year))) return true; + if (month == 2 && day == 29 && is_leap(year)) return false; + if (year > 9999 || month == 0 || month > 12 || day > s_days_in_month[month] || day == 0) { + return true; } - return year > 9999 || month > 12 || day > 31; + return false; } // The interval format is that with no delimiters --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
