SCM

[#1011287] Column Ordinal offset bug in the NpgsqlDataReader GetSchemaTable method

View Trackers | Bugs | Download .csv | Monitor

Date:
2012-12-05 06:05
Priority:
3
State:
Open
Submitted by:
Richard Meyer (meyerrj)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.12beta
Category:
None
Group:
None
Resolution:
None
Summary:
Column Ordinal offset bug in the NpgsqlDataReader GetSchemaTable method

Detailed description
In working on a custom data access layer with a colleague, we discovered an issue where the column ordinal values are incremented by 1 when going from the DataReader to the DataTable objects.

Lines 515 and 607 of Ngpgsql.NpgsqlDataReader are the culprits in version 2.0.12.

Per the MSDN specifications, ColumnOrdinal is a zero-based index:

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.getschematable.aspx

Attached is a patched version of NgpgsqlDataReader.cs that removes the + 1.

Followup

No Followups Have Been Posted

Attached Files:

Attachments:
NpgsqlDataReader.cs

Changes:

Field Old Value Date By
File Added784: NpgsqlDataReader.cs2012-12-05 06:05meyerrj
Powered By FusionForge