Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 28970 invoked from network); 8 Aug 2006 17:15:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 17:15:21 -0000 Received: (qmail 87995 invoked by uid 500); 8 Aug 2006 17:15:21 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 87942 invoked by uid 500); 8 Aug 2006 17:15:20 -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 87933 invoked by uid 99); 8 Aug 2006 17:15:20 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 10:15:20 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2006 10:15:13 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5D218410011 for ; Tue, 8 Aug 2006 17:12:17 +0000 (GMT) Message-ID: <25238466.1155057137379.JavaMail.jira@brutus> Date: Tue, 8 Aug 2006 10:12:17 -0700 (PDT) From: "Craig Russell (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-1516) Inconsistent behavior for getBytes and getSubString for embedded versus network In-Reply-To: <7606451.1153080613822.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1516?page=all ] Craig Russell updated DERBY-1516: --------------------------------- Attachment: DERBY-1516.patch I've updated the Derby workspace as of this morning. I've removed the formatting changes from blobclob4BLOB.java. They would have been duplicated by the changes anticipated by DERBY-1363. Tests pass. Check in at will. > Inconsistent behavior for getBytes and getSubString for embedded versus network > ------------------------------------------------------------------------------- > > Key: DERBY-1516 > URL: http://issues.apache.org/jira/browse/DERBY-1516 > Project: Derby > Issue Type: Bug > Components: JDBC > Reporter: Craig Russell > Assigned To: Craig Russell > Priority: Minor > Attachments: DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch > > > org.apache.derby.client.am.Clob.getSubString(pos, length) and org.apache.derby.client.am.Blob.getBytes(pos, length) check the length for less than zero. > if ((pos <= 0) || (length < 0)) { > throw new SqlException(agent_.logWriter_, "Invalid position " + pos + " or length " + length); > But org.apache.derby.impl.jdbc.EmbedClob(pos, length) and org.apache.derby.impl.jdbc.EmbedBlob(pos, length) check the length for less than or equal to zero. > if (length <= 0) > throw Util.generateCsSQLException( > SQLState.BLOB_NONPOSITIVE_LENGTH, new Integer(length)); > The specification does not disallow length of zero, so zero length should be allowed. I believe that the implementation in org.apache.derby.client.am is correct, and the implementation in org.apache.derby.impl.jdbc is incorrect. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira