db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
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 GMT
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);
         }
     }
     



Mime
View raw message