Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 130E618412 for ; Thu, 6 Aug 2015 21:59:30 +0000 (UTC) Received: (qmail 55433 invoked by uid 500); 6 Aug 2015 21:58:06 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 55417 invoked by uid 500); 6 Aug 2015 21:58:06 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 55404 invoked by uid 99); 6 Aug 2015 21:58:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Aug 2015 21:58:06 +0000 Date: Thu, 6 Aug 2015 21:58:05 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-10000) Dates before 1970-01-01 are not formatted correctly on cqlsh\Windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-10000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14660865#comment-14660865 ] Tyler Hobbs commented on CASSANDRA-10000: ----------------------------------------- Overall the patch looks good. The main problem I see is with this: {noformat} except Exception, e: return str(e) {noformat} I think the best option is to simply not catch the Exception at all and let it propagate (since we don't have any expected exceptions). Also, this fix is targeting 2.2, but 2.1 is also affected. Is there a reason not to fix it in 2.1? > Dates before 1970-01-01 are not formatted correctly on cqlsh\Windows > -------------------------------------------------------------------- > > Key: CASSANDRA-10000 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10000 > Project: Cassandra > Issue Type: Bug > Environment: windows > Reporter: Paulo Motta > Assignee: Paulo Motta > Priority: Minor > Labels: cqlsh, windows > Fix For: 2.2.x > > > The following test fails on Windows: > {code:none} > def test_past_and_future_dates(self): > self.cluster.populate(1) > self.cluster.start(wait_for_binary_proto=True) > node1, = self.cluster.nodelist() > node1.run_cqlsh(cmds=""" > CREATE KEYSPACE simple WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; > use simple; > create TABLE simpledate (id int PRIMARY KEY , value timestamp ) ; > insert into simpledate (id, value) VALUES (1, '2143-04-19T11:21:01+0000'); > insert into simpledate (id, value) VALUES (2, '1943-04-19T11:21:01+0000')""") > session = self.patient_cql_connection(node1) > rows = session.execute("select id, value from simple.simpledate") > output, err = self.run_cqlsh(node1, 'use simple; SELECT * FROM simpledate') > self.assertIn("2143-04", output) > self.assertIn("1943-04", output) > {code} > With the following message: > {noformat} > AssertionError: '1943-04' not found in "\r\n id | value\r\n----+-------------------------------------------\r\n 1 | 2143-04-19 08:21:01.-0300\r\n 2 | datetime.datetime(1943, 4, 19, 11, 21, 1)\r\n\r\n(2 rows)\r\nFailed to format value datetime.datetime(1943, 4, 19, 11, 21, 1) : (22, 'Invalid argument')\r\n" > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)