[plug] SQLite DB error - Everything functioning though?

Carl Gherardi carl.gherardi at gmail.com
Sun Jun 26 00:43:44 WST 2011


Hey Guys,

I'm a bit confused. I have an SQLite database assembled and populated
from a python application that functions perfectly well (the DB and
application).

Until...

 $ sqlite3 fpdb.db3
SQLite version 3.6.22
sqlite> REINDEX;
Error: database disk image is malformed
sqlite> REINDEX Hands;
Error: database disk image is malformed
sqlite> select count(*) from Hands;
Error: database disk image is malformed
sqlite> PRAGMA integrity_check;
Error: database disk image is malformed

The database is functioning quite happily from the application (python
using sqlite3 module), so i deleted the db and used the application to
recreate the db with no content - same result.

I'm suspecting an python sqlite3 mismatch v the command line tool but
i'm not able to find anything on the web

~/.fpdb/database  $ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.7.4'

Anyone come across anything similar?

....

Found the solution before hitting send.

a) I didn't have Ubuntu's sqlite3 installed.
b) sqlite3 existed standalone in an Android path, and was the version
mentioned above.

Turns out sqlite 3.7+ supports Write Ahead Logging, and my application
was setting this option.

Removing the Android dev env from my path, and actually installing
sqlite3 made things function as expected

Carl G



More information about the plug mailing list