SQLite VDBE opcode

TableLock

Obtain a lock on a particular table.

An example

None of the 178 statements we compiled against the sample database with SQLite 3.54.1 uses TableLock. Some opcodes appear only in debugging builds or with particular compile-time options, and some only in rare query plans.

What the SQLite documentation says

Obtain a lock on a particular table. This instruction is only used when the shared-cache feature is enabled.

P1 is the index of the database in sqlite3.aDb[] of the database on which the lock is acquired. A readlock is obtained if P3==0 or a write lock if P3==1.

P2 contains the root-page of the table to lock.

P4 contains a pointer to the name of the table being locked. This is only used to generate an error message if the lock cannot be obtained.

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.

← Subtract · Trace →