On Fri, Aug 13, 2010 at 10:34 PM, Colin Wetherbee <c...@denterprises.org>wrote:
> Hello. > > I believe the sqlite shell client is incorrectly telling me I have a > malformed > database image when I run VACUUM. As far as I can tell, the database is, > in > fact, uncorrupted, but the message is a bit scary. I'm using SQLite 3.7.0 > (as > packaged by the Debian maintainers), and the database, itself, was also > created with 3.7.0. > > $ sqlite3 hf.sqlite3 > SQLite version 3.7.0 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> pragma integrity_check; > ok > sqlite> vacuum; > Error: database disk image is malformed > sqlite> pragma integrity_check; > ok > Thanks for sending me your database file. The header of the database you sent me shows that you created the database using SQLite version 3.7.0 but that you made 406 subsequent updates to the database file using a prior version of SQLite. By updating the database using a prior version of SQLite you probably hit this bug: http://www.sqlite.org/src/info/51ae9cad317a1 That bug was fixed in 3.7.0.1, and in fact was the whole reason for the 3.7.0.1 emergency release. I recommend that you upgrade to version 3.7.0.1. Failing that, please do not use both 3.7.0 and prior versions of SQLite on the same database file because if you do 3.7.0 will give you corruption reports, or if you try to update the database using 3.7.0 after the database was previously written with a prior version of SQLite you might truly corrupt the database file. > > The error message appears every time I've tried to run VACUUM, but I'm able > to > continue executing queries in the same session afterward, and they always > succeed. Running VACUUM is the only time I've seen this error message. > > Why might this happen, and is there any way to narrow the problem, if any, > down a bit? I'm a bit worried that something might be breaking under the > hood and that it will rear its head later on in the form of something > catastrophic and horrible. :) > > My schema has three tables, and my application accesses it with PRAGMA > foreign_keys = ON. The only "abnormal" things about the schema are two > CHECK > constraints (on the same column) and one two-column unique index. One of > the > tables has about 200,000 rows, but the other two only have about 90. > > I would be happy to share my database and/or schema with anybody who is > interested. > > Thanks for your help. > > (Also, please CC me directly on any responses.) > > Colin > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users