pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Kris Jurka <books@ejurka.com>
Cc: Vaibhav Nivargi <vaibhav.nivargi@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Potential inconsistency in handling of timestamps
Date: Fri, 26 Oct 2007 11:37:20 +1300
Message-ID: <47211AA0.20102@opencloud.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0710251829240.29225@leary.csoft.net>
References: <a16dc64a0710251500v29de2294n864ec1249829f3b0@mail.gmail.com>
	<47211638.2080404@opencloud.com>
	<47211761.4080207@opencloud.com>
	<Pine.BSO.4.64.0710251829240.29225@leary.csoft.net>

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.ja...

@@ -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



view thread (6+ messages)  latest in thread

Message-ID: <47211AA0.20102@opencloud.com>
Permalink:  ../47211AA0.20102@opencloud.com/
Also on:    postgresql.org/message-id/47211AA0.20102@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, books@ejurka.com, vaibhav.nivargi@gmail.com
  Subject: Re: Potential inconsistency in handling of timestamps
  In-Reply-To: <47211AA0.20102@opencloud.com>
  References: <a16dc64a0710251500v29de2294n864ec1249829f3b0@mail.gmail.com> <47211638.2080404@opencloud.com> <47211761.4080207@opencloud.com> <Pine.BSO.4.64.0710251829240.29225@leary.csoft.net> <47211AA0.20102@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox