SQLite VDBE opcode

ElseEq

This opcode must follow an Lt or Gt comparison operator.

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

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

SELECT * FROM tracks WHERE (album_id, id) > (5, 10)
addropcodep1p2p3p4p5
0Init02700
1OpenRead04060
2OpenRead150k(2,,)0
3Integer5100
4IsNull12600
5SeekGE126110
6DeferredSeek1000
7Integer1200
8Column1030
9Gt4163BINARY-868
10ElseEq01300
11ZeroOrNull3240
12Goto01600
13IdxRowid1300
14Gt516368
15ZeroOrNull3250
16IfNot22510
17IdxRowid1600
18Column1070
19Column0280
20Column0390
21Column04100
22Column05110
23RealAffinity11000
24ResultRow6600
25Next1600
26Halt0000
27Transaction00101
28Integer5400
29Integer10500
30Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Column, DeferredSeek, Goto, Gt, Halt, IdxRowid, IfNot, Init, Integer, IsNull, Next, OpenRead, RealAffinity, ResultRow, SeekGE, Transaction, ZeroOrNull.

What the SQLite documentation says

This opcode must follow an Lt or Gt comparison operator. There can be zero or more OP_ReleaseReg opcodes intervening, but no other opcodes are allowed to occur between this instruction and the previous Lt or Gt.

If the result of an Eq comparison on the same two operands as the prior Lt or Gt would have been true, then jump to P2. If the result of an Eq comparison on the two previous operands would have been false or NULL, then fall through.

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.

← DropTrigger · EndCoroutine →