Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 8719 invoked from network); 6 Oct 2008 08:01:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Oct 2008 08:01:04 -0000 Received: (qmail 38420 invoked by uid 500); 6 Oct 2008 08:01:03 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 38395 invoked by uid 500); 6 Oct 2008 08:01:03 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 38383 invoked by uid 99); 6 Oct 2008 08:01:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 01:01:03 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 08:00:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2E0A02388879; Mon, 6 Oct 2008 01:00:14 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r701979 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java Date: Mon, 06 Oct 2008 08:00:14 -0000 To: derby-commits@db.apache.org From: kristwaa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081006080014.2E0A02388879@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kristwaa Date: Mon Oct 6 01:00:13 2008 New Revision: 701979 URL: http://svn.apache.org/viewvc?rev=701979&view=rev Log: DERBY-3871: EmbedBlob.setBytes returns incorrect insertion count. Fixed incorrect loop in test code. Patch file: derby-3871-2a-loop_fix.diff Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java?rev=701979&r1=701978&r2=701979&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java Mon Oct 6 01:00:13 2008 @@ -821,9 +821,10 @@ public static void transferAlphabetData(OutputStream writer, long length) throws IOException { byte[] buffer = new byte[8*1024]; + int bytesRead = 0; LoopingAlphabetStream contents = new LoopingAlphabetStream(length); - while (contents.read(buffer) > 0) { - writer.write(buffer); + while ((bytesRead = contents.read(buffer)) > 0) { + writer.write(buffer, 0, bytesRead); } }