SQLite

View Ticket
Login
Ticket Hash: 6c1d3febc00b22d457c78c201280ef3f7f423d1d
Title: REAL PRIMARY KEY leads to a missing entry in the index.
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-05-09 17:10:40
Version Found In: 3.28.0
User Comments:
drh added on 2019-05-09 15:07:16:

The following sequence of SQL statements results in a database where the primary key index has fewer rows than the table:

CREATE TABLE t1 (c0, c1 REAL PRIMARY KEY);
INSERT INTO t1(c0, c1) VALUES (0, 9223372036854775807), (0, 0);
UPDATE t1 SET c0 = NULL;
PRAGMA integrity_check;

This problem was discovered by Manuel Rigger and reported on the SQLite mailing list. Bisecting shows the problem being introduced by check-in [849e686da2d20fd7] which was a fix for ticket [38a97a87a6e4e83]. This was on 2015-11-06 and first appeared in the 3.10.0 release of SQLite.