System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2015-05-09
17:35 Ticket [74542e702e] System.Data.SQLite.SQLiteDataReader.RecordsAffected never returns -1 for SELECT statements status still Closed with 3 other changes artifact: efd662af64 user: mistachkin
2015-05-08
19:47 Ticket [74542e702e]: 4 changes artifact: ba07fd80dc user: anonymous
2015-04-21
18:21 Closed ticket [74542e702e]. artifact: 0c7a163495 user: mistachkin
18:21 Ticket [74542e702e]: 3 changes artifact: 4b48969cde user: mistachkin
18:18
Improve ADO.NET conformance of the SQLiteDataReader.RecordsAffected property. Fix for [74542e702e]. check-in: 68239f46ea user: mistachkin tags: trunk
17:42 Ticket [74542e702e] System.Data.SQLite.SQLiteDataReader.RecordsAffected never returns -1 for SELECT statements status still Open with 3 other changes artifact: ee371b46ac user: mistachkin
16:56 Ticket [74542e702e]: 3 changes artifact: d6cefabfa1 user: mistachkin
16:00 Ticket [74542e702e]: 3 changes artifact: c9c26a20e0 user: mistachkin
2015-04-20
05:28 Ticket [74542e702e]: 6 changes artifact: fa9f55bacf user: mistachkin
2015-04-18
17:54 Ticket [74542e702e]: 6 changes artifact: 225fb63dd2 user: mistachkin
11:07 New ticket [74542e702e]. artifact: 0fa3cbf178 user: anonymous

Ticket Hash: 74542e702edf73c18e6fb32e022afe9a48aec481
Title: System.Data.SQLite.SQLiteDataReader.RecordsAffected never returns -1 for SELECT statements
Status: Closed Type: Code_Defect
Severity: Important Priority: Blocker
Subsystem: Data_Reader Resolution: Fixed
Last Modified: 2015-05-09 17:35:24
Version Found In: 1.0.96.0
User Comments:
anonymous added on 2015-04-18 11:07:29:

System.Data.SQLite.SQLiteDataReader.RecordsAffected never returns -1 for SELECT statements

See https://msdn.microsoft.com/de-de/library/system.data.sqlclient.sqldatareader.recordsaffected%28v=vs.110%29.aspx

"The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements."

But SQLite always returns 0 for SELECTs:

// System.Data.SQLite.SQLiteDataReader
public override int RecordsAffected
{
	get
	{
		this.CheckDisposed();
		if (this._rowsAffected >= 0)
		{
			return this._rowsAffected;
		}
		return 0;
	}
}


mistachkin added on 2015-04-18 17:54:19:
Here is the link to the abstract method:

https://msdn.microsoft.com/en-us/library/system.data.idatareader.recordsaffected%28v=vs.110%29.aspx

mistachkin added on 2015-04-21 16:00:14:
This appears to have been the case for quite some time.  It could be changed;
however, it may represent a risk to backward compatibility.

mistachkin added on 2015-04-21 16:56:29:
As of the SQLite core library 3.7.4, an argument could be made that using the
sqlite3_stmt_readonly() native API in this context is useful.

mistachkin added on 2015-04-21 18:21:32:
Fixed on trunk via check-in [68239f46ea].

The returned value for the RecordsAffected property may be undefined in
some circumstances (i.e. since the value being read is per-connection,
not per-statement); however, it should now return -1 for SELECT statements.

anonymous added on 2015-05-08 19:47:07:
Indeed this does make the command executenonquery deliver a different result (-1) then previous releases (0)