Issue Details (XML | Word | Printable)

Key: DERBY-2425
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Mayuresh Nirhali
Reporter: Kathey Marsden
Votes: 0
Watchers: 0
Operations

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

ResultSetMetaData.getColumnDisplaySize() returns a negative value for BLOB columns for client

Created: 08/Mar/07 08:26 PM   Updated: 14/May/07 04:42 PM
Return to search
Component/s: Network Client
Affects Version/s: 10.3.1.4
Fix Version/s: 10.3.1.4

Time Tracking:
Not Specified

File Attachments:
  Size
File derby2425.diff 2007-04-25 03:03 PM Mayuresh Nirhali 1 kB

Resolution Date: 14/May/07 04:42 PM


 Description  « Hide

Client getColumnDisplaySize on a BLOB(1G) column returns
-2147483648

embedded returns 2147483647

In client, the issue is that for binary values it multiplies the length * 2 and this overflows the int range.
return (int) (2 * sqlLength_[column - 1]);


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mayuresh Nirhali added a comment - 25/Apr/07 03:03 PM
I have created a patch for this bug. It is very trivial, I think.

After multiplication (by 2 ) if the display size overflows int range, then assign Int.MAX_SIZE to display size.
This behavior is same as that in Embedded mode.

I have run derbyall and suites_All, no new failures were seen.

Patch is ready for review!


Kathey Marsden added a comment - 25/Apr/07 04:46 PM
committed this patch.
I also enabled the test for the issue in ResultSetMiscTest.java