jdbc1.AbstractJdbc1Statement.setBinaryStream bug and patch

Поиск
Список
Период
Сортировка
От Martin Holz
Тема jdbc1.AbstractJdbc1Statement.setBinaryStream bug and patch
Дата
Msg-id 200401071928.17842.holz@fiz-chemie.de
обсуждение исходный текст
Ответы Re: jdbc1.AbstractJdbc1Statement.setBinaryStream bug and
Re: jdbc1.AbstractJdbc1Statement.setBinaryStream bug and
Список pgsql-bugs
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.

Btw. setBinaryStream() should really throw an SQLException, if
in can not read as many bytes as expected from the InputStream.
Otherwise the application might silently loss data.

Regards
        Martin

--
Martin Holz     <holz@fiz-chemie.de>

Softwareentwicklung / Vernetztes Studium - Chemie
FIZ CHEMIE Berlin
Franklin Str. 11
D-10587 Berlin

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Crash while recovering database index relation
Следующее
От: Seum-Lim Gan
Дата:
Сообщение: Re: dyntest.pgc not working in 7.4 ?