Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A308A200CEF for ; Mon, 4 Sep 2017 17:21:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A183D165299; Mon, 4 Sep 2017 15:21:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E8D8F165298 for ; Mon, 4 Sep 2017 17:21:44 +0200 (CEST) Received: (qmail 66200 invoked by uid 500); 4 Sep 2017 15:21:42 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 66171 invoked by uid 99); 4 Sep 2017 15:21:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Sep 2017 15:21:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 81F64C8E42 for ; Mon, 4 Sep 2017 15:21:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 3hsf8db-TG2y for ; Mon, 4 Sep 2017 15:21:36 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C4CA85FDA3 for ; Mon, 4 Sep 2017 15:21:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v84FLXCr010878; Mon, 4 Sep 2017 15:21:33 GMT Date: Mon, 4 Sep 2017 15:21:33 +0000 From: "Csaba Ringhofer (Code Review)" To: Marcel Kornacker , impala-cr@cloudera.com, reviews@impala.incubator.apache.org Message-ID: Reply-To: csringhofer@cloudera.com X-Gerrit-MessageType: newchange Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5664=3A_Unix_time_to_timestamp_conversions_may_crash_impala_=28boost_exception=29=0A?= X-Gerrit-Change-Id: I77b2f6284d3a597f57e61c17a67c959eff9e38ff X-Gerrit-ChangeURL: X-Gerrit-Commit: 85333bd4184e64bf5ecdc75e48d5c6ff8933ddcc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 archived-at: Mon, 04 Sep 2017 15:21:45 -0000 Csaba Ringhofer has uploaded a new change for review. http://gerrit.cloudera.org:8080/7954 Change subject: IMPALA-5664: Unix time to timestamp conversions may crash impala (boost exception) ...................................................................... IMPALA-5664: Unix time to timestamp conversions may crash impala (boost exception) TimestampValue::FromSubsecondUnixTime and UtcFromUnixTimeMicros are incorrect only in case of the last second of 1399, because these sub-second values are rounded first towards 1400.01.01 00.00.00, which is accepted as a valid date, and the sub-second part is subtracted afterwards, leading to a date outside the valid interval. The maximum case, 9999.12.31 59.59.59 is a bit different, because as I understand, with nanosecond precision posix times, the maximum value is actually 10000.01.01. 00.00.00 minus 1 nanosec. TimestampValue::FromUnixTimeNanos can create problematic TimestampValues both <1400 and 10000<=. These timestamps can cause problems, because most code assumes that if HasDate/HasTime is true, then it really is a valid timestamp. Change-Id: I77b2f6284d3a597f57e61c17a67c959eff9e38ff --- M be/src/runtime/timestamp-test.cc M be/src/runtime/timestamp-value.h 2 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/54/7954/1 -- To view, visit http://gerrit.cloudera.org:8080/7954 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77b2f6284d3a597f57e61c17a67c959eff9e38ff Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Csaba Ringhofer