You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Gabriel39 (via GitHub)" <gi...@apache.org> on 2023/04/24 12:58:24 UTC

[GitHub] [doris] Gabriel39 commented on a diff in pull request #18872: [fix](planner) vdatetime_value.cpp:1585 Array access may overflow.

Gabriel39 commented on code in PR #18872:
URL: https://github.com/apache/doris/pull/18872#discussion_r1175246584


##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -1580,7 +1580,11 @@ bool VecDateTimeValue::date_add_interval(const TimeInterval& interval) {
         // This will change month and year information, maybe date.
         int64_t months = _year * 12 + _month - 1 + sign * (12 * interval.year + interval.month);
         _year = months / 12;
-        if (_year > 9999) {
+        DCHECK(months >= 0) << "months should be a non-negative number.";

Review Comment:
   Also fix this in DateV2Value<T>::date_add_interval



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org