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; a detected discrepancy raises SQLITE_CORRUPT_VTAB (267). [1]
Missed maintenance and the tested base-table REPLACE with recursive_triggers off left stale searches while PRAGMA and internal checks passed. Rank=1 rejected these states. Completed backup retained the mismatch; destination rebuild repaired current searches. [3] [4]
Consistency checking is not residual-content checking. In four internal-content deletion controls, all checks passed while residue differed: core secure_delete alone left shadow-token residue; FTS5 secure-delete alone left file residue; both removed this token from both scans. This is not the external-content synchronization fixture or a general forensic-erasure guarantee. [7]
Passing rank=1 does not prove historical text identity. Token-equivalent edits can pass. It also accepted unequal az/bq tokens through a checksum collision on SQLite 3.45.1 and 3.53.1; az/br was rejected. [10] [13]
Ordinary VACUUM renumbered an unindexed implicit-rowid content table. MATCH charlie returned hotel, PRAGMA/internal checks passed and rank=1 rejected 267. Rebuild restored searches, not original IDs. [15] [14]
Across 59 dependent states from 17 designed cases per build, 13 passed all three checks but failed historical-row or current-index comparison. Seven rebuilt states matched current text but not the old ID-to-text mapping. These are selected counterexamples, not failure rates. [16]
Relations
Limitations
- A shadow-blob count is not a count of recovered documents. Postings and deletion markers can contain the same token. [5]
- Rebuild follows current content rather than restoring original text. Compare preservation against a trusted prior reference. [10]
- The external-content check can accept different token instances when its internal checksum collides. [13, 12]
Citations
- SQLite FTS5: external content and integrity checking
- Hesela: eight executed FTS5 states and full query results
- Hesela: four REPLACE/UPSERT cases with rollback, trigger events and full query results
- SQLite FTS5: secure-delete and version compatibility
- SQLite: core secure_delete and virtual-table limits
- Hesela: generated SQLite deletion observations, two retained runs and explicit limits
- SQLite FTS5: Unicode61 tokenization defaults
- Hesela: five-case text-preservation evidence on SQLite 3.45.1 and 3.53.1
- SQLite 3.53.1 pinned entry-checksum implementation
- Hesela: three checksum controls on two SQLite builds
- SQLite: VACUUM and unaliased rowid changes
- Hesela: nine maintenance-identity cases on each of two SQLite builds
- Hesela: historical-row and current-index acceptance, 17 designed cases
- SQLite FTS5: instance vocabulary and token positions
Further reading
- Hesela: FTS5 query and verification controls
- Hesela: standalone SQLite deletion evidence, code and 42 raw files
- Hesela: exact evidence package, source map and replay limitations
Sources & caveats
- Eight designed observations, five exact ASCII-token queries per state, SQLite 3.45.1. No physical corruption or power-loss test.
- The deletion fixture scans exact token bytes without reconstructing complete records. [7]
- Retained 3.45.1 and 3.53.1 outcomes agree for the same five fixtures; diagnostic and trace differences remain explicit. No independent peer review. [10]
- Five one-row in-memory controls used unicode61, detail=full, columnsize=1 and no maintenance triggers. Minus/accent edits passed; changed-token/position controls failed. No physical-corruption or incident-rate measurement. [10] [9]
- Three one-row in-memory checksum controls were executed on two builds; complete diagnostics, query answers, copy and rebuild states retained. Not independent peer review. [13]
- Nine designed maintenance cases per build, closed DELETE journal and no concurrent writer. Independent source/prose review only; no independent native replication or incident-rate estimate. [15]
- The acceptance demonstrator uses fixed TEXT-only, unicode61, detail=full fixtures and a fresh index in the same SQLite engine. The baseline is known original input, not independently authenticated history or a general production checker. [16] [17]
- FTS5 secure-delete can affect readers older than 3.42.0 after updates or deletions; the deletion experiment did not test older readers or physical media. [5] [6]