Re: NULL Blob column error - PATCH FIX

From: Barry Lind <barry(at)xythos(dot)com>
To: David Wall <d(dot)wall(at)computer(dot)org>
Cc: pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: NULL Blob column error - PATCH FIX
Date: 2002-09-11 05:43:57
Message-ID: 3D7ED81D.7040401@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Patch applied.

--Barry

David Wall wrote:
> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-09-11 05:44:16 Re: BlobOutputStream patch and related patches
Previous Message Curt Sampson 2002-09-11 05:02:25 Re: little off-topic: stored procedures