SQLite

View Ticket
Login
Ticket Hash: 8fe768e9c9a3f463911ea93a8800cc947cca159d
Title: FTS integrity-check malfunctions
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-11-18 12:28:47
Version Found In: 3.30.0
User Comments:
mrigger added on 2019-10-05 23:29:10:

The following test case results in an error "database disk image is malformed", although the database does not seem to be corrupted:

CREATE TABLE t0(c0);
CREATE VIRTUAL TABLE vt0 USING fts5(c0);
BEGIN TRANSACTION;
INSERT INTO vt0(c0) VALUES (NULL);
ALTER TABLE t0 ADD COLUMN c5 REAL;
INSERT INTO vt0(vt0) VALUES('integrity-check'); -- unexpected: database disk image is malformed


drh added on 2019-11-18 12:28:47:

A new test case for this same problem was provided on the SQLite mailing list on 2019-11-18. Thanks to "king lion", a Korean student who found this new test case using a fuzzer. Note, however, that the problem has already been fixed in the 3.30.1 release.

BEGIN;
CREATE TABLE t1(a);
ALTER TABLE t1 ADD c CHECK (b>c);
PRAGMA writable_schema=on;
INSERT INTO t1 VALUES(2,3);