Re: [sqlite] damaged database recovery

2015-01-15 Thread Dave Dyer
it wasn't possible to drop the index in question what happened when you tried ? Were you using your own code or the SQLite shell tool ? sqlite shell tool. Same complaint, database corrupted. My guess is that you actually have file-level corruption which just happened to corrupt data in

Re: [sqlite] damaged database recovery

2015-01-15 Thread Dave Dyer
The likely cause of corruption is that this is probably a database being accessed on a networked disk. -- sqlite select * from preference_table where preferenceset='foo'; sqlite drop index preferenceindex; (11) database corruption at line 52020 of [2677848087] (11) statement aborts at 24: [drop

Re: [sqlite] damaged database recovery

2015-01-15 Thread Dave Dyer
I have a case of a damaged database, where the only damage appears to be that somehow the index uniqueness constraint is violated. As long as the operations don't touch the index, the db operates without complaint. I was eventually able to construct a copy with good indexes, but 1) the generic

Re: [sqlite] damaged database recovery

2015-01-15 Thread Simon Slavin
On 15 Jan 2015, at 8:24pm, Dave Dyer ddyer-sql...@real-me.net wrote: 1) the generic error 11 database corrupt could have been more specific. It would have been handy to know that the complaint was about duplicate indexes, and which index, or even which table was involved. 2) it wasn't

Re: [sqlite] damaged database recovery

2015-01-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/15/2015 12:52 PM, Dave Dyer wrote: Of course that's possible, but .dump produced what superficially appeared to be a perfectly consistent text file. Note that .dump writes the output and then on encountering problems attempts the table

Re: [sqlite] damaged database recovery

2015-01-15 Thread Richard Hipp
On 1/15/15, Dave Dyer ddyer-sql...@real-me.net wrote: The likely cause of corruption is that this is probably a database being accessed on a networked disk. -- sqlite select * from preference_table where preferenceset='foo'; sqlite drop index preferenceindex; (11) database corruption at

Re: [sqlite] damaged database recovery

2015-01-15 Thread Dave Dyer
Try doing: sqlite3 old-database .dump | sqlite3 fixed-database Then verify that fixed-database still contains all of your data. This doesn't work on these databases, even undamaged ones. I think it's a buffer size problem with sqlite3. The databases contain some rather long text strings.

Re: [sqlite] damaged database recovery

2015-01-15 Thread Richard Hipp
On 1/15/15, Dave Dyer ddyer-sql...@real-me.net wrote: it wasn't possible to drop the index in question what happened when you tried ? Were you using your own code or the SQLite shell tool ? sqlite shell tool. Same complaint, database corrupted. First type: .log stdout That will get