On 29 Jun 2016, at 5:36am, Joe Pasquariello <j...@fenway.com> wrote:

> These are the duplicate records. This index is associated with a UNIQUE 
> constraint on the original table. Is there a way to clean it up?

Unfortunately it's an automatic index and I hesitate to manipulate it manually 
in case it messes up something else automatic.  First, using the SQLite shell 
tool in interactive mode, try a simple way:

<https://www.sqlite.org/cli.html> ...

1) Make absolutely sure you have a backup copy of the database.
2) Execute the SQL command "VACUUM".
3) Test one of the SELECTs which was giving the wrong results.

If that doesn't fix the problem I would ...

1) Use .dump to dump your data to a text file.
2) Quit the shell tool.
3) Start it back up with another filename to create a new blank database.
4) Use .read to read the text file and execute it as commands
5) Test one of the SELECTs which was giving the wrong results.

If it works, delete the old database file and rename the new one.

On 29 Jun 2016, at 9:04am, R Smith <rsm...@rsweb.co.za> wrote:

> PS: Nice catch Simon - I did not even consider a broken index. I've never had 
> an SQLite file go corrupt on me


It was the only thing I could think of.  OP typing in diagnostic SELECT 
commands seemed to demonstrate enough weirdness that it was worth checking.  
Unfortunately it means that we have to wonder how the database got corrupted.

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

Reply via email to