SQLite VDBE opcode

ParseSchema

Read and parse all entries from the schema table of database P1 that match the WHERE clause P4.

An example

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

CREATE TRIGGER t1 AFTER INSERT ON artists BEGIN SELECT 1; END
addropcodep1p2p3p4p5
0Init01300
1OpenWrite01050
2String8020trigger0
3String8030t10
4String8040artists0
5Integer0500
6String8060CREATE TRIGGER t1 AFTER INSERT ON artists BEGIN SELECT 1; END0
7NewRowid0100
8MakeRecord257BBBDB0
9Insert07124
10SetCookie0120
11ParseSchema000type='trigger' AND name='t1'0
12Halt0000
13Transaction01101
14Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Goto, Halt, Init, Insert, Integer, MakeRecord, NewRowid, OpenWrite, SetCookie, String8, Transaction.

What the SQLite documentation says

Read and parse all entries from the schema table of database P1 that match the WHERE clause P4. If P4 is a NULL pointer, then the entire schema for P1 is reparsed.

When P4 is NULL, the P5 value is used as the mFlags argument to sqlite3InitOne(). In other words, P5 should be a mask composed of INITFLAG_* values.

The P4==0 case is only used by ALTER TABLE and P5!=0 for all such cases. For uses other than ALTER TABLE, P4<>0 and P5==0.

This opcode invokes the parser to create a new virtual machine, then runs the new virtual machine. It is thus a re-entrant opcode.

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.

← Param · Permutation →