Re: NULL Blob column error - PATCH FIX

From: "David Wall" <d(dot)wall(at)computer(dot)org>
To: "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: NULL Blob column error - PATCH FIX
Date: 2002-09-10 18:13:37
Message-ID: 000601c258f5$c8e86360$3201a8c0@expertrade.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Originally I thought this was going to be worse than I thought since I'm not
familiar with the fastpath code at all. However, a check of ResultSet.java
shows that the null check simply was not being done for getBlob().
Therefore, this patch for 7.2.2 will resolve the "FastPath call returned
ERROR: inv_open: large object 0 not found" exception when retrieving
Blob/OID that is NULL. I noted that this bug remains in the latest CVS as
well.

[postgresql(at)dev1 jdbc2]$ diff -c ResultSet.orig ResultSet.java
*** ResultSet.orig Sat Jan 5 14:26:22 2002
--- ResultSet.java Tue Sep 10 11:03:11 2002
***************
*** 931,936 ****
--- 931,940 ----

public Blob getBlob(int i) throws SQLException
{
+ wasNullFlag = (this_row[i - 1] == null);
+ if (wasNullFlag)
+ return null;
+
return new org.postgresql.largeobject.PGblob(connection,
getInt(i));
}

David

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2002-09-10 18:45:34 Re: [JDBC] problem with new autocommit config parameter and jdbc
Previous Message scott.marlowe 2002-09-10 17:46:17 Re: problem with new autocommit config parameter and jdbc