(text/x-fossil-wiki)
Consider the following test case:
<pre>
CREATE TABLE t0(c0);
CREATE INDEX i0 ON t0(0) WHERE c0 GLOB c0;
INSERT INTO t0 VALUES (0);
CREATE UNIQUE INDEX i1 ON t0(0);
CREATE UNIQUE INDEX i2 ON t0(0);
REPLACE INTO t0 VALUES(0);
SELECT COUNT(*) FROM t0 WHERE t0.c0 GLOB t0.c0; -- expected: 1, actual: 2
</pre>
Unexpectedly, the COUNT(*) computes that two rows are contained in the table, although only one was inserted:
<pre>
SELECT t0.c0 GLOB t0.c0 FROM t0; -- 1
</pre>
Further simplification of the first query also shows that the database disk image is corrupted:
<pre>
SELECT * FROM t0 WHERE t0.c0 GLOB t0.c0; -- database disk image is malformed
</pre>
|