You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Csaba Ringhofer (Code Review)" <ge...@cloudera.org> on 2018/09/05 12:05:50 UTC

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Csaba Ringhofer has uploaded this change for review. ( 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
---
M be/src/exprs/expr-test.cc
M be/src/exprs/timestamp-functions-ir.cc
2 files changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/90/11390/1
-- 
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: newchange
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 2: Verified+1


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 2
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Sep 2018 13:54:13 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/584/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Wed, 05 Sep 2018 12:39:24 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 2: Code-Review+2


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 2
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Sep 2018 10:32:44 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
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 <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
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 <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 1: Code-Review+2


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Thu, 06 Sep 2018 18:04:07 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 1:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/3114/ DRY_RUN=true


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Wed, 05 Sep 2018 12:13:49 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 2:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/3129/ DRY_RUN=false


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 2
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Fri, 07 Sep 2018 10:32:45 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7522: Fix overflow in milliseconds add()

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11390 )

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


Patch Set 1: Verified+1


-- 
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: comment
Gerrit-Change-Id: I491389257d6560873d942ac4f9a0fd836cc216da
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Wed, 05 Sep 2018 15:34:52 +0000
Gerrit-HasComments: No