SQLite

View Ticket
Login
Ticket Hash: 9fd058691b566188071be12f6983ec40d509d188
Title: Problem with updating an FTS table that contains a single row
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Extensions Resolution: Fixed
Last Modified: 2011-10-13 17:34:50
Version Found In: 3.7.7 through 3.7.8
Description:
If the only row in an FTS table is updated and the rowid/docid value is not changed, then the FTS index may become corrupt.

For example:

$ ./sqlite3 x
SQLite version 3.7.9 2011-10-13 16:36:29
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE VIRTUAL TABLE t USING fts3;      
sqlite> INSERT INTO t VALUES('xxx');
sqlite> .quit
Then:
$ ./sqlite3 x
SQLite version 3.7.9 2011-10-13 16:36:29
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> UPDATE t SET content = 'yyy';
sqlite> SELECT * FROM t WHERE t MATCH 'yyy';
Error: database disk image is malformed

dan added on 2011-10-13 17:33:07:
Introduced here [8f9666af]. Bug first appeared in release 3.7.7.


dan added on 2011-10-13 17:34:50:
Fixed here: [7e24645be2]