Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 2821 invoked from network); 20 Jun 2007 01:37:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jun 2007 01:37:49 -0000 Received: (qmail 54939 invoked by uid 500); 20 Jun 2007 01:37:52 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54511 invoked by uid 500); 20 Jun 2007 01:37:50 -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 54479 invoked by uid 99); 20 Jun 2007 01:37:50 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2007 18:37:50 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jun 2007 18:37:46 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 09A2471418E for ; Tue, 19 Jun 2007 18:37:26 -0700 (PDT) Message-ID: <9021024.1182303446020.JavaMail.jira@brutus> Date: Tue, 19 Jun 2007 18:37:26 -0700 (PDT) From: "Myrna van Lunteren (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Reopened: (DERBY-1816) Client's ResultSet.getTime() on a SQL TIMESTAMP column loses the sub-second resolution and always has a milli-second value of zero. In-Reply-To: <16078280.1157549482815.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Myrna van Lunteren reopened DERBY-1816: --------------------------------------- > Client's ResultSet.getTime() on a SQL TIMESTAMP column loses the sub-second resolution and always has a milli-second value of zero. > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-1816 > URL: https://issues.apache.org/jira/browse/DERBY-1816 > Project: Derby > Issue Type: Bug > Components: JDBC, Network Client > Affects Versions: 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.3.0.0 > Reporter: Daniel John Debrunner > Assignee: A B > Priority: Minor > Fix For: 10.3.0.0 > > Attachments: d1816_recycleCleanup_v1.patch, d1816_recycleCleanup_v2.patch, d1816_recycleCleanup_v2.stat, d1816_recycleCleanup_v3.patch, d1816_v1.patch, releaseNote.html, releaseNote.html > > > In embedded the java.sql.Time object returned from ResultSet.getTime() for a SQL TIMESTAMP object has its millisecond value for the time portion equal to that for the java.sql.Timestamp value. > In client the millisecond time value for such a value is always set to zero. > Note a Derby SQL TIME value has by definition resolution of only a second so its millisecond value is always zero, > but java.sql.Time is not a direct mapping to the SQL Type, it's a JDBC type, so when converting from a SQL TIMESTAMP > it should retain the precision. > The new test lang.TimeHandlingTest has this assert code that shows the problem, one of its calls will be commented out > with a comment with this bug number. > private void assertTimeEqual(Time tv, Timestamp tsv) > { > cal.clear(); > cal.setTime(tv); > > int hour = cal.get(Calendar.HOUR_OF_DAY); > int min = cal.get(Calendar.MINUTE); > int sec = cal.get(Calendar.SECOND); > int ms = cal.get(Calendar.MILLISECOND); > > // Check the time portion is set to the same as tv > cal.clear(); > cal.setTime(tsv); > assertEquals(hour, cal.get(Calendar.HOUR_OF_DAY)); > assertEquals(min, cal.get(Calendar.MINUTE)); > assertEquals(sec, cal.get(Calendar.SECOND)); > assertEquals(ms, cal.get(Calendar.MILLISECOND)); <<<<<<<<<<<<< FAILS HERE > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.