You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by kr...@apache.org on 2008/10/06 10:00:14 UTC
svn commit: r701979 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java
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);
}
}