Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5B8799F9954 for ; Thu, 25 Oct 2007 19:37:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 40309-02-5 for ; Thu, 25 Oct 2007 19:37:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 89FB99FC654 for ; Thu, 25 Oct 2007 19:37:22 -0300 (ADT) Received: from 222-154-141-112.jetstream.xtra.co.nz ([222.154.141.112] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IlBKG-0006Tn-KE; Fri, 26 Oct 2007 11:37:16 +1300 Message-ID: <47211AA0.20102@opencloud.com> Date: Fri, 26 Oct 2007 11:37:20 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Kris Jurka CC: Vaibhav Nivargi , pgsql-jdbc@postgresql.org Subject: Re: Potential inconsistency in handling of timestamps References: <47211638.2080404@opencloud.com> <47211761.4080207@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/141 X-Sequence-Number: 17713 Kris Jurka wrote: > > > On Fri, 26 Oct 2007, Oliver Jowett wrote: > >>> Null values should in theory get handled and returned well before >>> TimestampUtils ever gets invoked (see >>> AbstractJdbc2ResultSet.getTimestamp()). Can you supply a testcase >>> demonstrating the problem? >> >> Actually, it looks like this was fixed in AbstractJdbc2ResultSet r1.95 >> (I was looking at CVS HEAD) but not on the 8.2 branch. >> > > I don't follow. The commit you mention was unify the handling of the > RS.wasNull flag, not changing the handling of null values. That should > be caught in TimestampUtils.toTimestamp and friends. Well, it did change getTimestamp() so it returns null sooner: http://gborg.postgresql.org/cgi-bin/cvsweb.cgi/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java.diff?r1=1.94;r2=1.95;cvsroot=pgjdbc @@ -419,7 +425,9 @@ public abstract class AbstractJdbc2Resul public Timestamp getTimestamp(int i, java.util.Calendar cal) throws SQLException { - this.checkResultSet(i); + checkResultSet(i); + if (wasNullFlag) + return null; if (cal != null) cal = (Calendar)cal.clone(); You're right though, null should be caught by TimestampUtils.toTimestamp() too. Back to looking for a testcase? -O