Blob .getBytes position should start at 1

Started by Emmanuel Bernardabout 21 years ago2 messagespatches
Jump to latest
#1Emmanuel Bernard
emmanuel@hibernate.org

From the Javadoc of java.sql.Blob byte[] getBytes(long pos, int length)
throws SQLException;

* @param pos the ordinal position of the first byte in the
* <code>BLOB</code> value to be extracted; the first byte is at
* position 1

pqsql driver assumes the position starts from 0

Patch attached

--
Emmanuel Bernard
http://www.hibernate.org
callto://emmanuelbernard

Attachments:

blobfix.patchtext/plain; name=blobfix.patchDownload+2-1
#2Kris Jurka
books@ejurka.com
In reply to: Emmanuel Bernard (#1)
Re: Blob .getBytes position should start at 1

On Fri, 6 May 2005, Emmanuel Bernard wrote:

From the Javadoc of java.sql.Blob byte[] getBytes(long pos, int length)
throws SQLException;

* @param pos the ordinal position of the first byte in the
* <code>BLOB</code> value to be extracted; the first byte is at
* position 1

pqsql driver assumes the position starts from 0

Indeed. I've put a fix in 7.4, 8.0, and HEAD branches.

Thanks.

Kris Jurka