SQLite VDBE opcode

BitOr

Take the bit-wise OR of the values in register P1 and P2 and store the result in register P3.

An example

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

SELECT id & 1, id | 2, id << 3, id >> 1, ~id FROM tracks
addropcodep1p2p3p4p5
0Init01600
1OpenRead1190k(2,,)0
2Rewind115100
3IdxRowid1600
4BitAnd7610
5IdxRowid1600
6BitOr8620
7IdxRowid1600
8ShiftLeft9630
9IdxRowid1600
10ShiftRight7640
11IdxRowid1600
12BitNot6500
13ResultRow1500
14Next1301
15Halt0000
16Transaction00101
17Integer1700
18Integer2800
19Integer3900
20Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: BitAnd, BitNot, Goto, Halt, IdxRowid, Init, Integer, Next, OpenRead, ResultRow, Rewind, ShiftLeft, ShiftRight, Transaction.

What the SQLite documentation says

Take the bit-wise OR of the values in register P1 and P2 and store the result in register P3. If either input is NULL, the result 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.

← BitNot · Blob →