OracleDataReader.GetBytes() bug

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
miwi
Posts: 17
Joined: Thu 27 Jul 2006 10:42

OracleDataReader.GetBytes() bug

Post by miwi » Fri 04 Mar 2011 08:00

Hi,

the documentation for IDataReader requires that the function GetBytes "returns the number of available bytes in the field. Frequently this is the exact length of the field."

The OracleDataReader implementation instead, at least for Oracle RAW(n) fields, assumes that the field has at least "length" (function parameter) bytes and calls BlockCopy() which then throws an ArgumentException.

To reproduce, create a ROW(16) field, populate it, and call

Code: Select all

// var ix = IndexOfRawField;
var result = new byte[18];
var len = reader.GetBytes(ix, 0, result, 0, 18);
Found in 6.10.103.

I can workaround the issue simply using GetValue(), but however: May we get a fix for that, please?

Thanks,

miwi

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 07 Mar 2011 16:47

We have reproduced ArgumentException when the value of the length parameter is greater than an amount of bytes in the table's field. We will investigate this issue and notify you about the results as soon as possible.

miwi
Posts: 17
Joined: Thu 27 Jul 2006 10:42

Post by miwi » Fri 11 Mar 2011 14:46

Shalex wrote:as soon as possible.
As far as I can see the bug is already fixed in 6.10.121. Thank you!

miwi

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 14 Mar 2011 09:28

You are right. The 6.10.121 build of dotConnect for Oracle contains the fix for this problem.

Post Reply