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
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 13 | 0 | 0 | |
| 1 | OpenWrite | 0 | 1 | 0 | 5 | 0 |
| 2 | String8 | 0 | 2 | 0 | trigger | 0 |
| 3 | String8 | 0 | 3 | 0 | t1 | 0 |
| 4 | String8 | 0 | 4 | 0 | artists | 0 |
| 5 | Integer | 0 | 5 | 0 | 0 | |
| 6 | String8 | 0 | 6 | 0 | CREATE TRIGGER t1 AFTER INSERT ON artists BEGIN SELECT 1; END | 0 |
| 7 | NewRowid | 0 | 1 | 0 | 0 | |
| 8 | MakeRecord | 2 | 5 | 7 | BBBDB | 0 |
| 9 | Insert | 0 | 7 | 1 | 24 | |
| 10 | SetCookie | 0 | 1 | 2 | 0 | |
| 11 | ParseSchema | 0 | 0 | 0 | type='trigger' AND name='t1' | 0 |
| 12 | Halt | 0 | 0 | 0 | 0 | |
| 13 | Transaction | 0 | 1 | 1 | 0 | 1 |
| 14 | Goto | 0 | 1 | 0 | 0 |
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 →