SQLITE_CORRUPT_VTAB
SQLiteERRORCriticalCorruptionofficial confidence

Virtual table content is corrupt

Production Risk

High — FTS index may be unusable; rebuild or restore.

What this means

SQLITE_CORRUPT_VTAB (267) is an extended code returned by virtual table implementations when they detect internal corruption in their data store — not in the SQLite B-tree but in the virtual table's own storage.

Why it happens
  1. 1FTS (full-text search) index is inconsistent with the content table.
  2. 2Custom virtual table detected data corruption in its backing store.
How to reproduce

FTS3/FTS4/FTS5 integrity check or operations on a corrupt virtual table.

trigger — this will error
trigger — this will error
import sqlite3
conn = sqlite3.connect('my.db')
# Check FTS5 integrity:
try:
    conn.execute("INSERT INTO my_fts(my_fts) VALUES('integrity-check')")
except sqlite3.DatabaseError as e:
    print(e)  # database disk image is malformed

expected output

sqlite3.DatabaseError: database disk image is malformed

Fix 1

Fix 2

Fix 3

Sources
Official documentation ↗

sqlite3.h — SQLITE_CORRUPT_VTAB = 267

FTS5 integrity check

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All SQLite errors