From: Kris Jurka <books@ejurka.com>
To: Mikko Tiihonen <mikko.tiihonen@iki.fi>
Cc: pgsql-jdbc <pgsql-jdbc@postgresql.org>
Subject: Re: Fix resultset results after updateBinaryStream
Date: Fri, 27 Jul 2007 18:35:32 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0707271834530.19038@leary.csoft.net> (raw)
In-Reply-To: <1185048755.1632.68.camel@dual.local>
References: <1184972544.1632.55.camel@dual.local>
<Pine.BSO.4.64.0707211135400.27979@leary.csoft.net>
<1185048755.1632.68.camel@dual.local>
On Sat, 21 Jul 2007, Mikko Tiihonen wrote:
> On Sat, 2007-07-21 at 11:40 -0400, Kris Jurka wrote:
>>
>> On Sat, 21 Jul 2007, Mikko Tiihonen wrote:
>>
>>> The current UpdateableResultSet tests did not properly test more complex
>>> binary data updating. The following patch makes the test a bit harder
>>> and fixes the driver to pass the test.
>>
>> I think this works for the single row update and then retrieve test, but
>> if your ResultSet has two rows and you do update, next, and then getBytes,
>> won't it have the wrong fields[i].getFormat() value? The problem is that
>> we need to keep the format on a per row basis. Consider a scrollable
>> updatable resultset, any row can have either text or binary format. The
>> safest thing to do at the moment would be to encode the byte[] into the
>> text format that the server returns, but this is clearly not an ideal
>> solution.
>
> You are correct. Here's an updated patch that does just that. The newer unit
> test tests for the new case too. I first tried cloning the "fields" field and
> restoring it whenever the row moved. But that did not work when moving to a
> row that was inserted or updated. So we really do need either types per row
> or convert the fields into correct text/binary format during update.
>
> The actual fix is really hack. But at least it is passes the tests.
>
Fixed in CVS for 8.0, 8.1, 8.2, and HEAD.
Kris Jurka
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: books@ejurka.com, mikko.tiihonen@iki.fi
Subject: Re: Fix resultset results after updateBinaryStream
In-Reply-To: <Pine.BSO.4.64.0707271834530.19038@leary.csoft.net>
References: <1184972544.1632.55.camel@dual.local> <Pine.BSO.4.64.0707211135400.27979@leary.csoft.net> <1185048755.1632.68.camel@dual.local> <Pine.BSO.4.64.0707271834530.19038@leary.csoft.net>
* 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