On 11 Mar 2015, at 10:35am, Mario M. Westphal <mw at mwlabs.de> wrote:
> My application logs all error codes from SQLite but I have not seen anything > unusual in the logs provided to me by customers. I have even added an error > callback for SQLite (as per our recent discussion), to get more info about > the error. In the log files I have seem, this handler was not called and > there are no unusual errors. But the database corruption may be detected days > after the actual error happened, and then the original logs are gone. I > depend on my users to get logs and that does not work too well. Please take one of the databases which has been corrupted and see what the results of PRAGMA quick_check on it are. The intention is to find out whether you have a fast method of knowing that your database is corrupt. If the above does reliably spot the type of corruption you're seeing, you can incorporate it in some operation your app does frequently. Like opening or closing the database. This might give you a way to spot corruption much sooner after it occurs than to wait for SQLite to try to use the bit of the database which is corrupt. Simon.