FTS5 integrity-check
FTS5 integrity-check validates full-text index structures and can also compare them with an external content table.
For external content, rank=1 requests the additional comparison and a detected discrepancy raises SQLITE_CORRUPT_VTAB. [1]
Five deliberately inconsistent states passed both PRAGMA checks and the internal FTS5 check but failed the external comparison with code 267. A completed backup retained the stale query results. Rebuilding the destination index restored the expected answers without changing the source. [2] [3]
A second experiment retained every maintenance trigger. Base-table REPLACE with recursive_triggers off left an old-token match while PRAGMA and internal FTS5 checks passed; the external comparison rejected it. With recursive triggers on, or with the tested DO UPDATE UPSERT, all checks and expected queries passed. Explicit rollback restored baseline rows, queries and file hashes in all four controls. [4]
Relations
Citations
- SQLite FTS5: external content and integrity checking
- Hesela: FTS5 query and verification controls
- Hesela: eight executed FTS5 states and full query results
- Hesela: four REPLACE/UPSERT cases with rollback, trigger events and full query results
Sources & caveats
- Eight designed observations, five exact ASCII-token queries per state, SQLite 3.45.1. No physical corruption or power-loss test.