# SQLite deletion has more than one completion boundary

Research note, 30 October 2026. Synthetic native experiment, not a field study.
Status: prepared for review, not published on either Hesela domain.

## Answer

A missing search result does not establish erased index entries. An erased
current database page does not establish erased WAL history. An empty WAL does
not change an older backup. Our SQLite 3.45.1 controls observe all three
distinctions without changing or damaging a database file.

The contribution is a single evidence chain connecting FTS5 index maintenance,
SQLite page deletion, checkpoint outcomes and retained copies. It is not a new
vulnerability or a claim that SQLite violates its documented behavior.

## Two similar names, different work

The [FTS5 manual](https://www.sqlite.org/fts5.html#the_secure_delete_configuration_option)
describes a persistent per-table setting. Normally a deletion adds index
delete-keys and old index entries can remain until merging. Its secure-delete
setting removes affected entries instead. The manual also calls for the core
setting when file access, rather than SQL access alone, is in scope. It warns
that updates/deletions with the option may make the table incompatible with
FTS5 older than 3.42.0; that compatibility claim was not experimentally tested here.

The [core PRAGMA documentation](https://www.sqlite.org/pragma.html#pragma_secure_delete)
describes zeroing deleted ordinary-table content and explicitly limits what
that means for virtual-table shadow storage. FAST is not equivalent to ON;
compile options affect defaults. Our tests set OFF or ON explicitly before
inserting/deleting, rather than inheriting a distribution default.

In our rollback-journal experiment, the same three documents were inserted
in one transaction; the middle document contained one unique ASCII token.
We disabled FTS5 automerge to isolate the deletion operation. Each setting
combination used a fresh database, then closed and reopened it after deletion.

All four current row queries and MATCH queries agreed: the deleted document
was absent and both survivors remained. All ordinary integrity checks and the
FTS integrity command passed. Yet the outcomes were different:

- Core OFF, FTS OFF: the token remained in current shadow blobs and file bytes.
- Core ON, FTS OFF: the token still remained in current shadow blobs and file bytes.
- Core OFF, FTS ON: no current shadow blob contained it, but file bytes did.
- Core ON, FTS ON: neither the current shadow blobs nor the file scan contained it.

These are results for this token and layout. A positive byte match proves
residue. A negative match does not prove every possible representation was
erased, and we did not implement a general forensic record-recovery tool.
The same term could also legitimately remain if a surviving document used it.

The [upstream 3.45.1 FTS5 tests](https://raw.githubusercontent.com/sqlite/sqlite/version-3.45.1/ext/fts5/test/fts5secure.test)
check queries and integrity around secure-delete operations. We inspected
their intent, not executed that Tcl suite. Our independent retained-file
reader supplies different evidence: exact bytes and current shadow rows.

## A completed checkpoint is not a scrub

The [WAL design](https://www.sqlite.org/wal.html) separates appended changes
from their later transfer to the database file. Readers keep an earlier
committed view while writers advance. The [checkpoint API](https://www.sqlite.org/c3ref/wal_checkpoint_v2.html)
distinguishes FULL from RESTART and successful TRUNCATE; waiting can end with
a busy result. These distinctions must survive in an operational report.

Our second fixture used an ordinary three-row table, core secure_delete=ON,
WAL autocheckpoint disabled and one pinned pre-deletion read transaction.
The current writer lost the row after DELETE; the old reader still returned
it. A TRUNCATE attempt returned (1,4,3): busy, four log frames, three
checkpointed. Calling the operation was not evidence it had completed.

After releasing that reader, FULL and RESTART both returned (0,4,4). The
main-file scan no longer contained the token, but the 16,512-byte WAL still
did. Its exact bytes were unchanged between those two checkpoints. Successful
TRUNCATE returned (0,0,0) and reduced the accessible WAL length to zero.
The backup created before deletion still returned all three original rows.

The generated table records the six sequential states. They are not six
independent trials. Keeping the connection open and disabling automatic
checkpointing are deliberate controls, not claims about every application's
default lifecycle.

## What the older paper contributes

[Meng and Baier (DFRWS 2019)](https://doi.org/10.1016/j.diin.2019.04.017)
studied six deletion scenarios across twelve pragma combinations: 72
constructed databases. Table 1 reports the journal file when journaling is
enabled, rather than always the main database. Its WAL column preserves
records despite core secure deletion. Separately, their tool evaluation uses
27 files and 278 target records, with partial-recovery qualifications and
category-dependent limitations. That benchmark is not a population erasure
failure rate. We did not rerun bring2lite, reproduce its recovery score or
test its original corpus. Its broad wording about historical WAL frames must
not be read as indefinite retention: SQLite can reuse or truncate a WAL. Our
small experiment extends the question to FTS5
settings and explicitly observes checkpoint and retained-backup boundaries.

## Consequences for Hesela readers

This is an engineering inference from the controls: scope a deletion claim
to the observer, object and generation. Record current SQL visibility,
index-entry handling, accessible database/WAL bytes, old read views and
independent copies separately. An integrity-check result answers a different
question from residual-content inspection.

A successful logical-file test cannot certify SSD/NAND sanitization,
filesystem snapshot cleanup, remote backups, replicas, encryption-key
destruction or physical remanence. No raw device, power cut, crash or
performance measurement occurred. The experiment says nothing about legal
retention obligations. Do not remove a live WAL manually.

## Method and uncertainty

Python 3.12.3 with distribution SQLite 3.45.1 on Linux x86_64; the report
records sqlite_source_id, compile options and loaded-library fingerprints.
Two retained native runs have identical observed semantics, plus fresh
runs inside the normal and optimized test modes. WAL salt/checksum bytes
can differ between runs. A separately implemented verifier checks all
42 retained files across the pair and reopens copies of every WAL state.

This is one host, one SQLite build, tiny UTF-8 content, ordinary internal-content
FTS5 with its default tokenizer, 4096-byte pages and explicitly controlled
settings. No FTS3, external/contentless FTS5, SQLCipher, alternate VFS,
VACUUM, FAST mode, crash recovery or second-version comparison is claimed.
No frequencies, confidence intervals or universal no-recovery guarantee
can be inferred from designed counterexamples.

See TABLES.md for generated observations, sources.json for claim locators,
source-receipts.json for fetched-byte fingerprints and README.md for replay.
