Hello,
 
Customers using our Sqlite based application have reported some anomolies. It 
appears that the indices for the table have become corrupted somehow. I've 
attached a sample database which exhibits the issue. Can anyone offer some 
insight into how the table could have got into this state? Any suggestions for 
how we can prevent this from happening in the future (so far, this has been 
reported twice by our customers)? 
 
The sample database has one table called xdfema_properties, with 2 columns, 
Name and Value. The Name column is a primary key. 
 
If you do a "SELECT * FROM xdfema_properties" on the table, you'll see one 
problem immediately. There are 4 rows with a 'Name' value of 'SyncStartTicks', 
depsite the fact that the Name column is a primary key. 
 
Some more wierdness: if you select any of the rows after the "SyncCookie" row, 
such as:  SELECT * FROM xdfema_properties WHERE Name = 'NextPollFrom',
you get the 'SyncCookie' Value column, not the 'NextPollFrom' Value column.
 
If you change the query to use LIKE instead however, you get the correct row:  
SELECT * FROM xdfema_properties WHERE Name LIKE 'NextPollFrom'
 
I inferred that the indices for the table are corrupted, since I can repair the 
problem by removing the duplicated 'SyncStartTicks' rows and then executing a 
"REINDEX" statement. After this, the strange behavior goes away.
 
We are using the System.Data.Sqlite ADO.NET provider (v1.0.66) which I believe 
uses SQLite 3.6.23.1.
 
Any insights would be appreciated.
 
Richard
 
 
 
 
 
 
 
 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to