SQLite VDBE opcode

EndCoroutine

The instruction at the address in register P1 is a Yield.

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

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

WITH RECURSIVE n(i) AS (SELECT 1 UNION ALL SELECT i + 1 FROM n WHERE i < 10) SELECT i FROM n
addropcodep1p2p3p4p5
0Init02900
1InitCoroutine12320
2OpenPseudo1210
3OpenEphemeral2100
4Integer1300
5MakeRecord3140
6NewRowid2500
7Insert2458
8Rewind22200
9NullRow1000
10RowData2200
11Delete2000
12Column1060
13Yield1000
14Column1040
15Ge7214BINARY-880
16Column1040
17Add8430
18MakeRecord3140
19NewRowid2500
20Insert2458
21Goto0800
22EndCoroutine1000
23InitCoroutine1020
24Yield12800
25Copy6902
26ResultRow9100
27Goto02400
28Halt0000
29Integer10700
30Integer1800
31Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Add, Column, Copy, Delete, Ge, Goto, Halt, Init, InitCoroutine, Insert, Integer, MakeRecord, NewRowid, NullRow, OpenEphemeral, OpenPseudo, ResultRow, Rewind, RowData, Yield.

What the SQLite documentation says

The instruction at the address in register P1 is a Yield. Jump to the P2 parameter of that Yield. After the jump, the value register P1 is left with a value such that subsequent OP_Yields go back to the this same EndCoroutine instruction.

See also: InitCoroutine

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.

← ElseEq · Eq →