SQLite VDBE opcode

NoConflict

If P4==0 then register P3 holds a blob constructed by MakeRecord.

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

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

INSERT INTO genres VALUES ('Jazz', 'Swing') ON CONFLICT (name) DO UPDATE SET description = excluded.description
addropcodep1p2p3p4p5
0Init02200
1OpenWrite190k(1,)0
2String8020Jazz0
3String8030Swing0
4Null0100
5HaltIfNull129922genres.name1
6Affinity220BB0
7SCopy2500
8SCopy3600
9MakeRecord5240
10NoConflict120510
11Column10150
12Column10130
13Copy31400
14Affinity1320BB0
15SCopy13900
16SCopy141000
17MakeRecord9280
18IdxInsert18911
19Goto02100
20IdxInsert145117
21Halt0000
22Transaction01101
23Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Affinity, Column, Copy, Goto, Halt, HaltIfNull, IdxInsert, Init, MakeRecord, Null, OpenWrite, SCopy, String8, Transaction.

What the SQLite documentation says

If P4==0 then register P3 holds a blob constructed by MakeRecord. If P4>0 then register P3 is the first of P4 registers that form an unpacked record.

Cursor P1 is on an index btree. If the record identified by P3 and P4 contains any NULL value, jump immediately to P2. If all terms of the record are not-NULL then a check is done to determine if any row in the P1 index btree has a matching key prefix. If there are no matches, jump immediately to P2. If there is a match, fall through and leave the P1 cursor pointing to the matching row.

This opcode is similar to NotFound with the exceptions that the branch is always taken if any part of the search key input is NULL.

This operation leaves the cursor in a state where it cannot be advanced in either direction. In other words, the Next and Prev opcodes do not work after this operation.

See also: NotFound, Found, NotExists

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.

← Next · Noop →