Page 1 of 1

OracleDataReader.GetBytes() bug

Posted: Fri 04 Mar 2011 08:00
by miwi
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

Posted: Mon 07 Mar 2011 16:47
by Shalex
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.

Posted: Fri 11 Mar 2011 14:46
by miwi
Shalex wrote:as soon as possible.
As far as I can see the bug is already fixed in 6.10.121. Thank you!

miwi

Posted: Mon 14 Mar 2011 09:28
by Shalex
You are right. The 6.10.121 build of dotConnect for Oracle contains the fix for this problem.