System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
2012-05-26
00:09
Correct the test name for ticket [3aa50d8413]. check-in: 3e7d4b68b0 user: mistachkin tags: trunk
2012-05-25
23:36 Ticket [3aa50d8413] SQLiteDataAdapter.FillSchema throws NullReferenceException with multiple result sets status still Closed with 1 other change artifact: d1347df27a user: mistachkin
23:36 Ticket [3aa50d8413]: 1 change artifact: be08f96f61 user: mistachkin
23:28 Closed ticket [3aa50d8413]. artifact: 4891954f10 user: mistachkin
23:28
After disposing and just prior to re-creating the SQLiteKeyReader in the SQLiteDataReader.LoadKeyInfo method, reset it to null (i.e. this is important due to reentrancy issues). Fix for ticket [3aa50d8413]. check-in: b0c9d60ac7 user: mistachkin tags: trunk
22:18 Ticket [3aa50d8413] SQLiteDataAdapter.FillSchema throws NullReferenceException with multiple result sets status still Open with 3 other changes artifact: a369562279 user: mistachkin
22:18 New ticket [3aa50d8413]. artifact: 0a53a439ce user: mistachkin

Ticket Hash: 3aa50d841339abce404a0ce409392f3130f25295
Title: SQLiteDataAdapter.FillSchema throws NullReferenceException with multiple result sets
Status: Closed Type: Code_Defect
Severity: Important Priority: Blocker
Subsystem: Data_Reader Resolution: Fixed
Last Modified: 2012-05-25 23:36:45
Version Found In: 1.0.80.0
Description:
This issue was reported on the mailing list.

The root cause was a reentrancy issue where the _keyInfo field of the SQLiteDataReader was disposed just prior to being recreated; however, it was not subsequently set to null. Then, the GetSchemaTable method was invoked indirectly via the SQLiteKeyReader constructor, causing the code to call the AppendSchemaTable method on the disposed SQLiteKeyReader instance.


mistachkin added on 2012-05-25 23:28:56 UTC:
Fixed on trunk by check-in [b0c9d60ac7].


mistachkin added on 2012-05-25 23:36:18 UTC:
For future reference, the stack trace for this issue looks something like this:

System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Data.SQLite.SQLiteKeyReader.AppendSchemaTable(DataTable tbl) in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteKeyReader.cs:line 604
   at System.Data.SQLite.SQLiteDataReader.GetSchemaTable(Boolean wantUniqueInfo, Boolean wantDefaultValue) in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteDataReader.cs:line 1008
   at System.Data.SQLite.SQLiteKeyReader..ctor(SQLiteConnection cnn, SQLiteDataReader reader, SQLiteStatement stmt) in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteKeyReader.cs:line 172
   at System.Data.SQLite.SQLiteDataReader.LoadKeyInfo() in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteDataReader.cs:line 1319
   at System.Data.SQLite.SQLiteDataReader.NextResult() in c:\dev\sqlite\dotnet\System.Data.SQLite\SQLiteDataReader.cs:line 1218
   at System.Data.Common.DataAdapter.FillSchemaFromReader(DataSet dataset, DataTable datatable, SchemaType schemaType, String srcTable, IDataReader dataReader)
   at System.Data.Common.DataAdapter.FillSchema(DataSet dataSet, SchemaType schemaType, String srcTable, IDataReader dataReader)
   at System.Data.Common.DbDataAdapter.FillSchemaInternal(DataSet dataset, DataTable datatable, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchema(DataSet dataSet, SchemaType schemaType, IDbCommand command, String srcTable, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillSchema(DataSet dataSet, SchemaType schemaType)
   at _Dynamic16144.Test16144.Main()