From derby-dev-return-26234-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Tue Aug 08 18:48:59 2006 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 75366 invoked from network); 8 Aug 2006 18:48:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Aug 2006 18:48:59 -0000 Received: (qmail 39729 invoked by uid 500); 8 Aug 2006 18:48:58 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 39516 invoked by uid 500); 8 Aug 2006 18:48:58 -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 39505 invoked by uid 99); 8 Aug 2006 18:48:58 -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 11:48:58 -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 11:48:57 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D1D9C41000C for ; Tue, 8 Aug 2006 18:46:14 +0000 (GMT) Message-ID: <3050223.1155062774857.JavaMail.jira@brutus> Date: Tue, 8 Aug 2006 11:46:14 -0700 (PDT) From: "Craig Russell (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (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=comments#action_12426674 ] Craig Russell commented on DERBY-1516: -------------------------------------- Here's a proposed javadoc comment for EmbedClob.getSubString: * Valid pos values require that 0 < pos < clob.length + 1. * Valid length values require that 0 <= length <= clob.length. If this looks ok, I can update the javadoc for the other implementation classes. > 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