Re: jdbc1.AbstractJdbc1Statement.setBinaryStream bug and

From: Kris Jurka <books(at)ejurka(dot)com>
To: Martin Holz <holz(at)fiz-chemie(dot)de>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: jdbc1.AbstractJdbc1Statement.setBinaryStream bug and
Date: 2004-01-15 10:37:03
Message-ID: Pine.LNX.4.33.0401150534490.13549-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

On Wed, 7 Jan 2004, Martin Holz wrote:

> Hello,
>
> org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream()
> in postgresql 7.4.1 wrongly assumes, that
> java.io.InputStream.read(byte[] b,int offset,int len )
> will always read len bytes. InputStream only guarantees to
> return at least 1 byte per call. The attached patch solves the bug.
>

I have applied a version of this patch to the cvs version on gborg. The
setAsciiStream and setUnicodeStream methods also had this problem. Your
patch was not quite right because it didn't correctly handle the situation
where the Stream was longer than the given length.

Kris Jurka

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kris Jurka 2004-01-15 10:45:07 Re: BUG #1048: error connection to dbms from java app server
Previous Message Tom Lane 2004-01-15 04:49:54 Re: BUG #1050: cannot restore db at postgresql 7.4.1

Browse pgsql-jdbc by date

  From Date Subject
Next Message Moreno Mauri 2004-01-15 14:50:18 SQLState with pg74.1jdbc3.jar
Previous Message Kris Jurka 2004-01-15 00:34:38 Re: patch: improve exception propagation in testcases