SQLite VDBE opcode

Expire

Cause precompiled statements to expire.

An example

18 of the 178 statements we compiled against the sample database use Expire. This is the one with the shortest program; the rows that use Expire are highlighted.

PRAGMA wal_checkpoint
addropcodep1p2p3p4p5
0Init0500
1Expire1100
2Checkpoint12010
3ResultRow1300
4Halt0000
5Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Checkpoint, Goto, Halt, Init, ResultRow.

What the SQLite documentation says

Cause precompiled statements to expire. When an expired statement is executed using sqlite3_step() it will either automatically reprepare itself (if it was originally created using sqlite3_prepare_v2()) or it will fail with SQLITE_SCHEMA.

If P1 is 0, then all SQL statements become expired. If P1 is non-zero, then only the currently executing statement is expired.

If P2 is 0, then SQL statements are expired immediately. If P2 is 1, then running SQL statements are allowed to continue to run to completion. The P2==1 case occurs when a CREATE INDEX or similar schema change happens that might help the statement run faster but which does not affect the correctness of operation.

From sqlite.org's list of opcodes for SQLite 3.54.1, in the public domain. Opcodes are not a stable interface and change between releases.

← Eq · Explain →