SQLITE_CORRUPT_INDEX
SQLiteERRORCriticalCorruptionofficial confidence

Index is inconsistent with table

Production Risk

High — queries using the index may return incorrect results.

What this means

SQLITE_CORRUPT_INDEX (779) is returned during an integrity check when an index entry does not match the corresponding table row — the index is out of sync with the data.

Why it happens
  1. 1Partial write failure left index and table in an inconsistent state.
  2. 2Bug in SQLite or a third-party storage layer.
  3. 3Index rebuilt incorrectly by an external tool.
How to reproduce

PRAGMA integrity_check or PRAGMA quick_check.

trigger — this will error
trigger — this will error
import sqlite3
conn = sqlite3.connect('my.db')
result = conn.execute('PRAGMA integrity_check').fetchall()
for row in result:
    print(row)  # may show "row X missing from index Y"

expected output

"row 42 missing from index idx_users_email on table users"

Fix 1

Fix 2

Fix 3

Version notes

Sources
Official documentation ↗

sqlite3.h — SQLITE_CORRUPT_INDEX = 779

PRAGMA integrity_check

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

← All SQLite errors