Re: [sqlite] UNIQUE INDEX behaves differently depending on the order rows are inserted

2016-11-03 Thread Ben Hearsum
On Wed, Nov 02, 2016 at 11:30:37PM -0400, Richard Hipp wrote: > On 11/2/16, Ben Hearsum wrote: > > I've also had a couple of kernel panics lately, and I imagine that could > > either directly cause issues, or cause issues the next time Firefox starts > > (and tries to recover). > > SQLite is supp

Re: [sqlite] UNIQUE INDEX behaves differently depending on the order rows are inserted

2016-11-02 Thread Richard Hipp
On 11/2/16, Ben Hearsum wrote: > I've also had a couple of kernel panics lately, and I imagine that could > either directly cause issues, or cause issues the next time Firefox starts > (and tries to recover). SQLite is suppose to recover from a kernel panic without corrupting. So I hope that is n

Re: [sqlite] UNIQUE INDEX behaves differently depending on the order rows are inserted

2016-11-02 Thread Ben Hearsum
Just in case it's not obvious, this is a database that's part of my Firefox profile. The database was likely corrupted during an upgrade to Firefox (I've been speaking with the folks that work on Firefox profiles, too), but I've also had a couple of kernel panics lately, and I imagine that could ei

Re: [sqlite] UNIQUE INDEX behaves differently depending on the order rows are inserted

2016-11-02 Thread Richard Hipp
On 11/2/16, Ben Hearsum wrote: > > I then did some inserts, and discovered that the order in which the rows are > inserted appears to be affecting the uniqueness of the index: > sqlite> insert into moz_places_bhearsum select * from moz_places order by > guid; > sqlite> reindex moz_places_bhearsum;

Re: [sqlite] UNIQUE INDEX behaves differently depending on the order rows are inserted

2016-11-02 Thread Richard Hipp
Can you send me the moz_places.sqlite file you are using to my private email? Or get it to me by some other means. So that we can try to reproduce this? On 11/2/16, Ben Hearsum wrote: > Hi there, > > I recently had an issue with an index in a large-ish (>100,000 rows) table > becoming corrupted

[sqlite] UNIQUE INDEX behaves differently depending on the order rows are inserted

2016-11-02 Thread Ben Hearsum
Hi there, I recently had an issue with an index in a large-ish (>100,000 rows) table becoming corrupted. I tried to issue a REINDEX on it, but it complained of duplicated values. I dug into that a bit, and couldn't find any duplicate entries: sqlite> select count(*) from moz_places; 100575 sqli