Hello,
recently some of my customers suffered from data corruption in sqlite database. Hopefully, no data(?) was lost. The person, that found this bug, doesn't recall what was doing that time; there's a hard machine lock-up possible (on Win98, I'd hardly connect this with sqlite itself).
Anyway, the database contained one corrupted row, which had same value in
"unique" field as some other record. After .dump / restore (and loosage of
that one, corrupted row) database seems to be fine.
Opening and reading from that damaged table resulted in coredumps (unix) and creashes (win32).
I have the damaged file. How can I debug, what was wrong - and if it really was sqlite fault?
Version 2.8.12 of SQLite fixes a bug in the rollback logic which might have caused database corruption if an OS crash occurred at a very inauspicious moment. See:
http://www.sqlite.org/cvstrac/tktview?tn=599
The chance of this actually happening is very low, but it might have been the cause of your problem. What version of SQLite was running when you encountered the problem?
It has been reported to me that some versions of Windows do not correctly implement the FlushFileBuffers() system call. I have not independently verified this claim - this is just hearsay. But if the report is true, then an OS crash can corrupt the database and there is nothing that SQLite can do differently to prevent it. The problem is in the OS.
If you want to check for corruption in a database, do this:
PRAGMA integrity_check;
If no errors are found, this pragma will return a single row with the value "ok". If errors are found, they will be reported one per row.
-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

