SCM

[#1010829] ForwardsOnlyDataReader.IsDBNull(int) throws InvalidOperationException with CommandBehavior.SequentialAccess

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-05-25 14:45
Priority:
3
State:
Open
Submitted by:
István Nagy (nagyi)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.9
Category:
Group:
Resolution:
None
Summary:
ForwardsOnlyDataReader.IsDBNull(int) throws InvalidOperationException with CommandBehavior.SequentialAccess

Detailed description
Create an arbitrary query with 2 or more columns.
Execute the command with CommandBehavior.SequentialAccess | CommandBehavior.SingleResult.
Try to read sequentially checking every field if it is DBNull. Somewhat simplified:
while(reader.Read())
{
if (!reader.IsDBNull(0))
reader.GetInt(0);
if (!reader.IsDBNull(1)) // InvalidOperationException
reader.GetInt(1);
}

StackTrace:
bei Npgsql.ForwardsOnlyRow.SetIndex(Int32 index, Boolean allowCurrent) in C:\projects\Npgsql2\src\Npgsql\NpgsqlRow.cs:Zeile 137.
bei Npgsql.ForwardsOnlyRow.IsDBNull(Int32 index) in C:\projects\Npgsql2\src\Npgsql\NpgsqlRow.cs:Zeile 192.
bei Npgsql.ForwardsOnlyDataReader.IsDBNull(Int32 i) in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:Zeile 1448.

Followup

Message
Date: 2010-05-31 21:02
Sender: Josh Cooley

I was able to reproduce this in a unit test. There's now a fix in CVS, and will be in the next release. Can you test out this fix?

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge