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:
<verbatim>
$ ./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
</verbatim>
Then:
<verbatim>
$ ./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
</verbatim>
<hr><i>dan added on 2011-10-13 17:33:07:</i><br>
Introduced here [8f9666af]. Bug first appeared in release 3.7.7.
<hr><i>dan added on 2011-10-13 17:34:50:</i><br>
Fixed here: [7e24645be2]
|