Using sqlite in our embedded device has offered tremendous capabilities and very conveniently, and I thank the developers and enthusiasts who continue to further this excellent project.

I've had one issue that I cannot explain and would ask for some input.

sqlite 3.1.3
linux kernel 2.6.12
cris-axis-linux-gnu

One field system began to issue "database disk image is malformed" for reasons that I cannot yet explain. I ran a PRAGMA integrity_check, which told me:

sqlite> PRAGMA integrity_check;
*** in database main ***
Main freelist: 1 of 1 pages missing from overflow list starting at 0
Page 46 is never used
rowid 1355980 missing from index timestamp
rowid 1356049 missing from index timestamp
...
rowid 1356108 missing from index timestamp
wrong # of entries in index timestamp
wrong # of entries in index dataid
sqlite>

VACUUM failed with the same "database disk image is malformed". Attempts at deleting all records from the broken table failed. In the end, I was able to repair the database by bringing it down to my workstation and loading it in the SQLite Administrator windows GUI and executing Database: cleanup.

My database is built using the following PRAGMA statements:

pragma    PRAGMA auto_vacuum = 1;
pragma    PRAGMA count_changes = 1;
pragma    PRAGMA empty_result_callbacks = 1;
pragma    PRAGMA legacy_file_format = OFF;
pragma    PRAGMA synchronous = OFF;

1) are there any tools available in sqlite3 that will help me find the cause of this type of issue?
2) does anyone know what did SQLite Administrator do that VACUUM didn't?
3) since auto_vacuum is ON, I still need to do a VACUUM every so often. Any ideas why?

/mark richards

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to