On 3/12/15, Mario M. Westphal <mw at mwlabs.de> wrote:
> One thing to add:
>
>
>
> I was sometimes successful to remote-repair a corrupted database by telling
> the user how to use sqlite3.exe and calling REINDEX.
>
>
>
> After learning that, I added this to my diagnosis routine so if
> integrity_check() returns something that?s not ?ok?, my application runs a
> REINDEX on the database and then runs integrity_check again. These cases are
> now automatically repaired and usually go unnoticed by the user. I tried to
> find a reproducible case where indices get broken or out of sync with the
> pages, but was unable to.
>

I'm sure your users appreciate the automatic fixes.  So that's
probably the right thing to do.  Nevertheless, this is really just
masking a much deeper problem that needs to be rooted out.

Can you change your application so that when an automatic repair does
occur, it saves off a copy of the "PRAGMA integrity_check" output as
well as other diagnostic information into a file, then asks the user
to email that file to you?

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to