Hello,

I think SQLite has a bug causing PRAGMA integrity_check to falsely report errors under certaincircumstances detailed below.

To reproduce:

Start SQLiteConsole ( version 3.19.3, the binary distributions both for Windows and Linux will do and

so does the 3.20.0 preview compiled with Visual Studio 2017)in a directory that doesn't yet contain

test1.db or test2.db.

Then execute the following statements:


.open test1.db

CREATE TABLE Table1 (col TEXT NOT NULL PRIMARY KEY);

ATTACH 'test2.db' AS db2;

CREATE TABLE db2.Table2(col1 INTEGER, col2 INTEGER, col3 INTEGER, col4 INTEGER);

CREATE UNIQUE INDEX db2.idx_col1_unique ON Table2 (col1);

CREATE UNIQUE INDEX db2.idx_col23_unique ON Table2 (col2, col3);

CREATE INDEX db2.idx_col2 ON Table2 (col2);

CREATE INDEX db2.idx_col4 ON Table2 (col4);

INSERT INTO Table2 VALUES(1,2,3,4);

INSERT INTO Table2 VALUES(5,6,7,8);

PRAGMA integrity_check;

This leads to the following output:

wrong # of entries in index idx_col23_unique

wrong # of entries in index idx_col1_unique

At least in the situation I simplified this from, the actual databases were not really damaged.


By the way, I tried to report this from my work account a few days ago, but it never made it to the list,

so perhapst the spam filters are a little overzelous?

Greetings,

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

Reply via email to