Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 68954 invoked from network); 9 Mar 2006 05:18:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Mar 2006 05:18:12 -0000 Received: (qmail 75311 invoked by uid 500); 9 Mar 2006 05:18:04 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 75071 invoked by uid 500); 9 Mar 2006 05:18:04 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 75062 invoked by uid 99); 9 Mar 2006 05:18:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 21:18:03 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 21:18:03 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax (Postfix) with ESMTP id EC7D8D49FB for ; Thu, 9 Mar 2006 05:17:41 +0000 (GMT) Message-ID: <953577334.1141881461966.JavaMail.jira@ajax> Date: Thu, 9 Mar 2006 05:17:41 +0000 (GMT) From: "Daniel John Debrunner (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-889) with client getTimestamp on a TIME column will print the date 1900-01-01 instead of the current date In-Reply-To: <2013405366.1138509152955.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-889?page=comments#action_12369602 ] Daniel John Debrunner commented on DERBY-889: --------------------------------------------- The cached calendar is a performance optimization. Ideally we would re-use it as I think we found out that Calendar objects are expensive to create. I don't understand your change to EmbedResultSet, the cal field can be set by other calls so what exactly is removing the lines doing here? There is a slight difference between what the SQL standard says and what you have implemented. The SQL standard says the DATE fields are taken from CURRENT_DATE which is not exactly the same as today's date. The difference is the CURRENT_DATE remains fixed for the lifetime of a SQL statement, thus if a query crosses midnight the value CURRENT_DATE does not change. (and similar for CURRENT_TIMESTAMP) Now I have not looked into this to see if the engine performs this correctly for a cast of a TIME to a TIMESTAMP. The other question would then be, should the JDBC operation getTimestamp() on a TIME column be the same as cast? > with client getTimestamp on a TIME column will print the date 1900-01-01 instead of the current date > ----------------------------------------------------------------------------------------------------- > > Key: DERBY-889 > URL: http://issues.apache.org/jira/browse/DERBY-889 > Project: Derby > Type: Bug > Components: Network Client > Versions: 10.1.2.1, 10.1.2.2, 10.2.0.0, 10.1.3.0 > Reporter: Kathey Marsden > Assignee: Bryan Pendleton > Attachments: derby-889.diff > > On client getTimestamp on a TIME column will print date 1900-01-01 instead of the current date like the embedded driver. > To repro run the DERBY-877 repro without specifying a file.encoding > java TestEnc derbynetclient > [snip] > COLUMN 2:TM TIME > getString: 16:27:35 > getTimeStamp: 1900-01-01 16:27:35.0 > getTime: 16:27:35 > getDate Exception SQLSTATE:null (EXPECTED) > With Embedded it prints the current date for getTimestamp > java TestEnc derby > COLUMN 2:TM TIME > getString: 16:27:35 > getTimeStamp: 2006-01-28 16:27:35.0 > getTime: 16:27:35 > getDate Exception SQLSTATE:22005 (EXPECTED) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira