Interesting, I have got a database on a (cheap) thumbdrive that gets corrupted as well. It has happened three times to me now.
It is a tiny database (< 200 kB) behind a website and it is under very little stress: perhaps 10 insert/update statements *per day*. The website is running on a router with DD-WRT firmware installed and is accessing the database through PHP with a SQLite modules (version 3.7.0 I believe, slightly old). Other than the occacional crash it is running perfectly. I have backups of before (clean) and after the 10 inserts (corrupt) but have not been able to reproduce the problem no matter how hard I try. -- Jos Groot Lipman -----Original Message----- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Folkert van Heusden Sent: woensdag 4 januari 2012 15:21 To: sqlite-users@sqlite.org Subject: [sqlite] /**** ERROR: (11) database disk image is malformed *****/ Hi, Occasionally my sqlite database (which recides on a jffs2 filesystem on a nor flash) gets corrupt. Of course, I would like to fix that. While debugging such a corrupt database, I found the following: Pgno: 2 btreeInitPage: corrupt flag byte is: 01 database corruption at line 49445 of [c7c6050ef0] line 49445 is: return SQLITE_CORRUPT_BKPT (in decodeFlags) the line number is a little bit offsetted due to added debug code I used version 3.7.9 to debug the problem. the program using sqlite is using 3.6.18. no triggers used. I checked that the pagesize is 1024 bytes (with PRAGMA page_size;). What could be the cause of this? - the system writing garbage to the flash disk? - not all data being flushed correctly? (e.g. a partial write) - bug in 3.6.18? If it helps I can give a hexdump of the first 3KB of the databasefile. Thanks, Folkert van Heusden _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users