Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 97031 invoked from network); 17 Aug 2010 11:04:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Aug 2010 11:04:40 -0000 Received: (qmail 3232 invoked by uid 500); 17 Aug 2010 11:04:40 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 3026 invoked by uid 500); 17 Aug 2010 11:04:38 -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 3019 invoked by uid 99); 17 Aug 2010 11:04:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Aug 2010 11:04:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Aug 2010 11:04:36 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7HB4Gqs029839 for ; Tue, 17 Aug 2010 11:04:16 GMT Message-ID: <27406419.392111282043056323.JavaMail.jira@thor> Date: Tue, 17 Aug 2010 07:04:16 -0400 (EDT) From: "Yun Lee (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-3898) Blob.setBytes differs between embedded and client driver when the specified length is invalid In-Reply-To: <635685995.1222965224260.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-3898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899372#action_12899372 ] Yun Lee commented on DERBY-3898: -------------------------------- That's right, thanks, Knut. > Blob.setBytes differs between embedded and client driver when the specified length is invalid > --------------------------------------------------------------------------------------------- > > Key: DERBY-3898 > URL: https://issues.apache.org/jira/browse/DERBY-3898 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.1.1, 10.6.1.0 > Reporter: Kristian Waagan > Assignee: Yun Lee > Priority: Minor > Fix For: 10.7.0.0 > > Attachments: derby-3898-1.patch, derby-3898-1.stat, derby-3898-testcase.patch, derby-3898-testcase.stat, Derby3898.java, enable-javame.diff, overflow.diff > > > Blob.setBytes behaves differently with the embedded driver and the client driver. > Assume a 1 byte array and a specified length of 2: Blob.setBytes(1, new byte[] {0x69}, 0, 2) > Embedded: IndexOutOfBoundsException (from java.io.RandomAccessFile.writeBytes or System.arraycopy) > Client: succeeds, returns insertion count 1 > The behavior should be made consistent, but what is the correct behavior? > From the Blob.setBytes JavaDoc: > "Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written. The array of bytes will overwrite the existing bytes in the Blob object starting at the position pos. If the end of the Blob value is reached while writing the array of bytes, then the length of the Blob value will be increased to accomodate the extra bytes." -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.