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.
<hr /><i>mistachkin added on 2012-05-25 23:28:56 UTC:</i><br />
Fixed on trunk by check-in [b0c9d60ac7].
<hr /><i>mistachkin added on 2012-05-25 23:36:18 UTC:</i><br />
For future reference, the stack trace for this issue looks something like this:
<verbatim>
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()
</verbatim>
|