Re: [sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Mario M. Westphal
> If you have a contrary example, please send me a > copy of the database file via private email. I take it from your reply that the integrity_check indeed should reveal problems in the database file which cause the "disk image malformed" return code so my logic is OK as it is. Unfortunately,

Re: [sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Simon Slavin
On 8 Nov 2013, at 3:06pm, Mario M. Westphal wrote: > The first phase in my analysis checks the data in the database for logical > problems, business logic issues etc. > After this phase has been completed, my diagnosis function runs: > > 1. PRAGMA integrity_check(100) > 2.

Re: [sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Richard Hipp
On Fri, Nov 8, 2013 at 10:06 AM, Mario M. Westphal wrote: > > 1. PRAGMA integrity_check(100) > 2. VACUUM > 3. ANALYZE > > My idea was that these routines should reveal problems reading from or > writing to the database file. > > Today I had a case where my diagnosis considered a

[sqlite] How to detect "database disk image malformed" in advance?

2013-11-08 Thread Mario M. Westphal
I have implemented diagnostic routines which allow my users to check the database for problems. If something bad happens to a database (which may be not the fault of SQLite at all, e.g. a network problem or disk problem) I want to detect this as early as possible in order to inform the user. This