Issue Details (XML | Word | Printable)

Key: DERBY-121
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: A B
Reporter: Lynh Nguyen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Network Server reading blob/clob data size

Created: 15/Jan/05 11:13 AM   Updated: 04/Jun/05 04:30 PM
Return to search
Component/s: Network Server
Affects Version/s: 10.1.1.0
Fix Version/s: 10.1.1.0

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-121_2.stat 2005-06-03 03:21 AM A B 1 kB
Text File Licensed for inclusion in ASF works derby-121_3.patch 2005-06-03 05:44 AM A B 20 kB
Environment: The is a bit shift typo in Network Server reading clob/blob data size

Resolution Date: 04/Jun/05 04:30 PM


 Description  « Hide
in DDMReader.java
...
... readLengthAndCodePoint() ... {
...

switch (numberOfExtendedLenBytes) {
case 8:
ddmScalarLen =
((buffer[pos++] & 0xff) << 64) +
((buffer[pos++] & 0xff) << 56) +
((buffer[pos++] & 0xff) << 48) +
((buffer[pos++] & 0xff) << 40) +
((buffer[pos++] & 0xff) << 32) +
((buffer[pos++] & 0xff) << 16) +
((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
adjustSize = 12;
break;
case 6:
ddmScalarLen =
((buffer[pos++] & 0xff) << 48) +
((buffer[pos++] & 0xff) << 40) +
((buffer[pos++] & 0xff) << 32) +
((buffer[pos++] & 0xff) << 16) +
((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
adjustSize = 10;
break;
case 4:
ddmScalarLen =
((buffer[pos++] & 0xff) << 32) +
((buffer[pos++] & 0xff) << 16) +
((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
adjustSize = 8;
break;
...
The shift bits should be in order:
0,8,16,24
0,8,16,24,32,40
0,8,16,24,32,40,48,56

This will only affect a lob if its length requires at least 24 bits--i.e. if the lob has a length of at least 2^24 bytes.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #179859 Fri Jun 03 19:12:14 UTC 2005 kmarsden DERBY-121 - Network Server issue reading blob/clob data size

1) Change Network Server and Derby Client code to do correct bit-shifting when processing the length of LOBs that are larger than 2^24 bytes (DERBY-121). 2) Add a new suite, "largeData", for running tests that require extra machine resources, and add the test for DERBY-121 to that suite (because the test for DERBY-121 requires extra heap memory for the server's JVM).

Contributed by Army Brown
Files Changed
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/lobLengthTests_app.properties
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/lobLengthTests.java
MODIFY /incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMReader.java
MODIFY /incubator/derby/code/trunk/java/testing/build.xml
MODIFY /incubator/derby/code/trunk/java/testing/README.htm
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/build.xml
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeData.properties
MODIFY /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata/copyfiles.ant
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataClient.properties
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/largedata
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataTests.runall
MODIFY /incubator/derby/code/trunk/java/client/org/apache/derby/client/net/Reply.java
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/lobLengthTests.out
ADD /incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/largeDataNet.properties