Fix integrity checks for WITHOUT ROWID and FTS5 tables #5

Merged
ober merged 1 commit from fix/integrity-virtual-table-schema into master 2026-09-06 04:37:41 -04:00
Owner

PRAGMA integrity_check treated every stored table as a rowid B-tree. Valid WITHOUT ROWID tables use index B-trees, so a schema containing one (including an FTS5 shadow table) raised SQLITE_CORRUPT: expected a table b-tree page.

Select the existing index reader for WITHOUT ROWID storage while retaining CHECK constraint verification. This fixes direct and table-valued integrity_check/quick_check queries. Version advances to 0.1.5; the compatibility notes retain the existing limits of the integrity audit.

Validation on macOS arm64:

  • Reproduced the failure with a minimal WITHOUT ROWID table, FTS5, and the Bot Commons complete schema test.
  • make build, make unit, and make binary passed with the existing jerbuild toolchain.
  • Focused tests/unit/test-pragma.ss: 283 checks, zero failures or errors (12 new checks).
  • The unchanged Bot Commons schema test compiled against this source passed migrations, reopen, rollback, FTS5, integrity, and blob-inclusive backup restoration.
  • Native CLI --help, make security, changed-line security scan, and git diff --check passed.
  • make diff explicitly skipped: the optional reference checkout is absent. No SQLite FFI was used.

No target-host deployment or production claim is included.

`PRAGMA integrity_check` treated every stored table as a rowid B-tree. Valid `WITHOUT ROWID` tables use index B-trees, so a schema containing one (including an FTS5 shadow table) raised `SQLITE_CORRUPT: expected a table b-tree page`. Select the existing index reader for `WITHOUT ROWID` storage while retaining CHECK constraint verification. This fixes direct and table-valued `integrity_check`/`quick_check` queries. Version advances to 0.1.5; the compatibility notes retain the existing limits of the integrity audit. Validation on macOS arm64: - Reproduced the failure with a minimal WITHOUT ROWID table, FTS5, and the Bot Commons complete schema test. - `make build`, `make unit`, and `make binary` passed with the existing jerbuild toolchain. - Focused `tests/unit/test-pragma.ss`: 283 checks, zero failures or errors (12 new checks). - The unchanged Bot Commons schema test compiled against this source passed migrations, reopen, rollback, FTS5, integrity, and blob-inclusive backup restoration. - Native CLI `--help`, `make security`, changed-line security scan, and `git diff --check` passed. - `make diff` explicitly skipped: the optional reference checkout is absent. No SQLite FFI was used. No target-host deployment or production claim is included.
fix: scan WITHOUT ROWID storage during integrity checks
All checks were successful
version-policy / required (pull_request) Successful in 3m50s
required-ci / required (pull_request) Successful in 7m16s
7cac56135a
ober scheduled this pull request to auto merge when all checks succeed 2026-09-06 04:36:55 -04:00
ober merged commit c7c01614f0 into master 2026-09-06 04:37:41 -04:00
ober referenced this pull request from a commit 2026-09-06 04:37:42 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ober/jerboa-sqlite!5
No description provided.