Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 30598 invoked from network); 16 Apr 2009 13:21:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Apr 2009 13:21:39 -0000 Received: (qmail 37891 invoked by uid 500); 16 Apr 2009 13:21:39 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 37828 invoked by uid 500); 16 Apr 2009 13:21:39 -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 37820 invoked by uid 99); 16 Apr 2009 13:21:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2009 13:21:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Apr 2009 13:21:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 46135234C04C for ; Thu, 16 Apr 2009 06:21:15 -0700 (PDT) Message-ID: <497536664.1239888075284.JavaMail.jira@brutus> Date: Thu, 16 Apr 2009 06:21:15 -0700 (PDT) From: "Yun Lee (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Assigned: (DERBY-4107) DATE function returns wrong result for integer argument In-Reply-To: <1639651564.1237640390578.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4107?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yun Lee reassigned DERBY-4107: ------------------------------ Assignee: Yun Lee > DATE function returns wrong result for integer argument > ------------------------------------------------------- > > Key: DERBY-4107 > URL: https://issues.apache.org/jira/browse/DERBY-4107 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.4.2.0 > Environment: MS Windows XP Professional Version 2002 Service Pack 2, running NetBeans IDE 6.5 > Reporter: Nelson Rodrigues > Assignee: Yun Lee > > When Derby Reference Manual, version 10.4, lists Derby limitations for DATE is said that the smallest DATE value is 0001-01-01 and the largest DATE value is 9999-12-31. > When the same manual explains the DATE function is said that: > "The argument must be ... a positive number less than or equal to 2,932,897 ... The result is the date that is n-1 days after January 1, 0001, where n is the integral part of the number." > Testing for the largest integer returns the expected result: > select date(2932897) from SYSIBM.SYSDUMMY1 returns 9999-12-31 -> OK > The problem comes when testing the smallest integer. We get a result different than we expect: > select date(1) from SYSIBM.SYSDUMMY1 returns 1970-01-01, but it should have returned 0001-01-01 > The smallest date we get using integer as an argument to date function should be the same we get when using the smallest string representation as an argument. In other words date(1) should be equal to date('0001-01-01'). > select date('0001-01-01') from SYSIBM.SYSDUMMY1 returns 0001-01-01 -> OK -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.