Le
This works just like the Lt opcode except that the jump is taken if the content of register P3 is less than or equal to the content of register P1.
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
12 of the 178 statements we compiled against the sample database use Le. This is the one with the shortest program; the rows that use Le are highlighted.
SELECT CASE WHEN ms > 300000 THEN 'long' ELSE 'short' END FROM tracks
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 11 | 0 | 0 | |
| 1 | OpenRead | 0 | 4 | 0 | 4 | 0 |
| 2 | Rewind | 0 | 10 | 0 | 0 | |
| 3 | Column | 0 | 3 | 2 | 0 | |
| 4 | Le | 3 | 7 | 2 | BINARY-8 | 84 |
| 5 | String8 | 0 | 1 | 0 | long | 0 |
| 6 | Goto | 0 | 8 | 0 | 0 | |
| 7 | String8 | 0 | 1 | 0 | short | 0 |
| 8 | ResultRow | 1 | 1 | 0 | 0 | |
| 9 | Next | 0 | 3 | 0 | 1 | |
| 10 | Halt | 0 | 0 | 0 | 0 | |
| 11 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 12 | Integer | 300000 | 3 | 0 | 0 | |
| 13 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Column, Goto, Halt, Init, Integer, Next, OpenRead, ResultRow, Rewind, String8, Transaction.
What the SQLite documentation says
This works just like the Lt opcode except that the jump is taken if the content of register P3 is less than or equal to the content of register P1. See the Lt opcode for additional information.
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.
← Last · LoadAnalysis →