IsNull
Jump to P2 if the value in register P1 is NULL.
Jumps: P2 is an instruction address. In the listings here, a jump is drawn as an arc and the address is a link.
An example
40 of the 178 statements we compiled against the sample database use IsNull. This is the one with the shortest program; the rows that use IsNull are highlighted.
SELECT * FROM genres WHERE name = ?
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 11 | 0 | 0 | |
| 1 | OpenRead | 1 | 9 | 0 | k(1,) | 2 |
| 2 | Variable | 1 | 1 | 0 | 0 | |
| 3 | IsNull | 1 | 10 | 0 | 0 | |
| 4 | Affinity | 1 | 1 | 0 | B | 0 |
| 5 | SeekGE | 1 | 10 | 1 | 1 | 0 |
| 6 | IdxGT | 1 | 10 | 1 | 1 | 0 |
| 7 | Column | 1 | 0 | 2 | 0 | |
| 8 | Column | 1 | 1 | 3 | 0 | |
| 9 | ResultRow | 2 | 2 | 0 | 0 | |
| 10 | Halt | 0 | 0 | 0 | 0 | |
| 11 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 12 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Affinity, Column, Goto, Halt, IdxGT, Init, OpenRead, ResultRow, SeekGE, Transaction, Variable.
What the SQLite documentation says
Jump to P2 if the value in register P1 is NULL.
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.
← IntegrityCk · IsTrue →