And at least show us the code where you're doing your insert...my money says you're doing it wrong.
Michael D. Black Senior Scientist NG Information Systems Advanced Analytics Directorate ________________________________ From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of a.azzol...@custom.it [a.azzol...@custom.it] Sent: Tuesday, August 23, 2011 7:01 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Autoincrement failure Reindex procedure returns 'no_error' but rowid=1 is still present 37 times with same values How can I avoid to fall in this bug? It's very dangerous because any new INSERT operation terminate successfully but previous data has beeen overwrited with new one (on rowid =1) Many thanks, Alessandro From: Richard Hipp <d...@sqlite.org> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Date: 22/08/2011 17.40 Subject: Re: [sqlite] Autoincrement failure On Mon, Aug 22, 2011 at 11:25 AM, <a.azzol...@custom.it> wrote: > schema 3 > > PRAGMA integrity_check > returns > > *** in database main *** > rowid 0 missing from index JournalDateIndex > rowid 0 missing from index sqlite_autoindex_Journal_1 > wrong # of entries in index JournalDateIndex > wrong # of entries in index sqlite_autoindex_Journal_1 > Try running "REINDEX" and see if that clears up the problem. > > > > > > From: > Richard Hipp <d...@sqlite.org> > To: > General Discussion of SQLite Database <sqlite-users@sqlite.org> > Date: > 22/08/2011 17.21 > Subject: > Re: [sqlite] Autoincrement failure > > > > On Mon, Aug 22, 2011 at 11:17 AM, <a.azzol...@custom.it> wrote: > > > SELECT rowid FROM (mytable) WHERE (mystuff) > > > > returns > > > > 37 identical rows(!) where Rowid = 1 > > > > What is your schema? > > If you run "PRAGMA integrity_check"? > > > > > > > > > > Alessandro > > > > > > > > > > From: > > a.azzol...@custom.it > > To: > > <sqlite-users@sqlite.org> > > Date: > > 22/08/2011 16.26 > > Subject: > > Re: [sqlite] Autoincrement failure > > > > > > > > sqlite> .dump sqlite_sequence > > PRAGMA foreign_keys=OFF; > > BEGIN TRANSACTION; > > COMMIT; > > sqlite> > > > > > > Any idea? > > > > Thanks > > Alessandro > > > > > > > > From: > > Richard Hipp <d...@sqlite.org> > > To: > > General Discussion of SQLite Database <sqlite-users@sqlite.org> > > Date: > > 22/08/2011 16.11 > > Subject: > > Re: [sqlite] Autoincrement failure > > > > > > > > On Mon, Aug 22, 2011 at 9:56 AM, <a.azzol...@custom.it> wrote: > > > > > Hallo, > > > > > > Have you ever seen a SQLite3 DB file with autoincrement algoritm > broken? > > > Every new record seems to be added with rowid=1 overwriting existing > > > info... > > > > > > Any idea about the causes of this issue > > > and about extracting lost data (if present)? > > > > > > > Please run from the sqlite3.exe shell: > > > > .dump sqlite_sequence > > > > Tell us what you see. > > > > > > > > > > Many thanks > > > Alessandro > > > _______________________________________________ > > > sqlite-users mailing list > > > sqlite-users@sqlite.org > > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > > > > > > -- > > D. Richard Hipp > > d...@sqlite.org > > _______________________________________________ > > 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 > > > > > > _______________________________________________ > > sqlite-users mailing list > > sqlite-users@sqlite.org > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > > > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > 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 > -- D. Richard Hipp d...@sqlite.org _______________________________________________ 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 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users