I assume that by "I manage to get the same error corruption again." you mean 
that if you read the value using the shell tool rather than your own code, you 
get back the unexpected value rather than the value for the BLOB you think you 
put there.

Hmm.  So the database structure isn't corrupt, but it has the wrong value 
stored in a field somehow.  This makes me even more suspicious that the fault 
is in your code somewhere rather than in the code for one of the SQLite 
functions.

Can you check whether the value is corrupted immediately ?  in other words, as 
soon as you've finished with your INSERT commands and closed the transaction ?

On 26 Feb 2012, at 10:12pm, Patrik Nilsson <nipatriknils...@gmail.com> wrote:

> It says "ok"! I manage to get the same error corruption again.
> 
> I removed the defines "SQLITE_ENABLE_COLUMN_METADATA" and
> "SQLITE_ENABLE_MEMORY_MANAGEMENT".
> 
> /PN
> 
> On 02/26/2012 10:19 PM, Simon Slavin wrote:
>> 
>> On 26 Feb 2012, at 8:40pm, Patrik Nilsson <nipatriknils...@gmail.com> wrote:
>> 
>>> Yes. My program starts two thread, the main one and a worker. There are
>>> mutexes so only one at a time can the sqlite interface.
>> 
>> Hmm.  Once you have done the thing that apparently corrupts your database, 
>> quit your app and use the sqlite3 command-line tool to look at your 
>> database.  Run
>> 
>> PRAGMA integrity_check; 
>> 
>> and also have it display the field which you think is corrupt and check that 
>> the corrupt value really is stored in the database rather than just being 
>> returned by your SELECT command.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to