Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/11390 )

Change subject: IMPALA-7522: Fix overflow in milliseconds_add()
......................................................................

IMPALA-7522: Fix overflow in milliseconds_add()

Adding milliseconds to a timestamp lead to overflow if
the interval is very large. This hit a DCHECK in debug
builds and returned incorrect results in release builds.

The following queries returned 2237-09-01 05:47:53.709551616
before the fix while the correct result is 1653-02-10 06:13:20:
select milliseconds_add("1970-01-01", -10000000000000);
select CAST(0 AS TIMESTAMP) + INTERVAL -10000000000000 MILLISECONDS;

Testing:
- added new test to expr-test.cc + ran it
- generally there are no tests for the *_add form, only the
  + INTERVAL ... form. The two means the same, so I did not
  duplicate the test.

Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Reviewed-on: http://gerrit.cloudera.org:8080/11390
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/exprs/expr-test.cc
M be/src/exprs/timestamp-functions-ir.cc
2 files changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/11390
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 3
Gerrit-Owner: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>

Reply via email to