Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53D4C9869 for ; Tue, 13 Mar 2012 15:37:06 +0000 (UTC) Received: (qmail 10379 invoked by uid 500); 13 Mar 2012 15:37:05 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 10304 invoked by uid 500); 13 Mar 2012 15:37:05 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 10290 invoked by uid 99); 13 Mar 2012 15:37:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2012 15:37:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2012 15:37:02 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F1BF71E967 for ; Tue, 13 Mar 2012 15:36:41 +0000 (UTC) Date: Tue, 13 Mar 2012 15:36:41 +0000 (UTC) From: "Kristian Waagan (Commented) (JIRA)" To: derby-dev@db.apache.org Message-ID: <1526376231.8130.1331653002008.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1216256031.43093.1320101612189.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-5489) getBinary() returns incorrect data after getObject() call on BLOB column MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-5489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13228447#comment-13228447 ] Kristian Waagan commented on DERBY-5489: ---------------------------------------- I've been talking to Lance Anderson, the JDBC spec lead, and the intention is to specify that getBytes is supported on BLOB columns in a future release/update of the JDBC specification. The same goes for getString on CLOB columns. The recommended way to access a BLOB is still through getBlob. This makes it clear that we must allow getBytes on BLOB columns, but the existing restriction we have on calling a getter only once on a LOB column will still be there. Knut, the answer to your question is definitely yes :) > getBinary() returns incorrect data after getObject() call on BLOB column > ------------------------------------------------------------------------ > > Key: DERBY-5489 > URL: https://issues.apache.org/jira/browse/DERBY-5489 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.7.1.1, 10.8.2.2 > Reporter: Pawel Fronczak > Labels: derby_triage10_9 > Attachments: SelectBlobBug.java, repro.diff > > > When ResultSet.getObject(int) is called on a BLOB column, the correct EmbedBlob object is returned. But if afterwards the ResultSet.getBytes(int) is called on the same row, the returned array contains invalid data - it is offset by 3 bytes and its size is incorrect. > The problem only occurs when the stored BLOB is large enough to be internally represented by stream and not by array of bytes (at least ~32KiB). > It seems that the getObject method shifts the stream position and therefore the getBytes method starts to read the data after the third byte, thus incorrectly calculating its length. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira