The vacuum followed by a reindex seems to have fixed the db (see below). But are there any other theories as to how we got to this point? Could I have possibly caused this or do I just need to build in code to detect problems like this and rebuild on the fly? I'm new to SQLite so I don't have a good feel for what is overkill vs what is best practices.

Thanks!

Jeff


vacuum
**Command returned 0**

pragma integrity_check
wrong # of entries in index sqlite_autoindex_messages_priority_1
**1 rows returned**

reindex messages_priority
**Command returned 0**

pragma integrity_check
ok
**1 rows returned**

select id,created from messages_priority order by id limit 5
id    created
423    2/12/2017 8:07:09 PM
424    2/12/2017 8:07:10 PM
425    2/12/2017 8:07:11 PM
426    2/12/2017 8:07:12 PM
427    2/12/2017 8:07:13 PM
**5 rows returned**

select id,created from messages_priority where id = 424
id    created
424    2/12/2017 8:07:10 PM
**1 rows returned**


On 2/13/2017 12:59 PM, Simon Slavin wrote:
On 13 Feb 2017, at 6:55pm, Jeff B. <su...@cox.net> wrote:

Should have read up on integrity_check before posting the results... I 
re-worked my tool and here is the output:


pragma integrity_check;

*** in database main ***
On tree page 11 cell 0: Rowid 424 out of order
wrong # of entries in index sqlite_autoindex_messages_priority_1
**2 rows returned**
Just like they said, your index is corrupt.  Unfortunately it’s an automatic 
index so you can’t easily remake it.  And you have a password-protected 
database and maybe you can’t use the shell tool on it.

Make a backup copy of the database file, just in case.  Then try the VACUUM 
command.  Then to the integrity_check thing again.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to