OracleDataReader.GetBytes() bug
Posted: 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
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
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);
I can workaround the issue simply using GetValue(), but however: May we get a fix for that, please?
Thanks,
miwi