SQLite VDBE opcode

VRename

P4 is a pointer to a virtual table object, an sqlite3_vtab structure.

An example

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

ALTER TABLE lyrics RENAME TO songs
addropcodep1p2p3p4p5
0Init016000
1Null0120
2OpenEphemeral1010
3OpenRead01030
4Rewind01500
5Column0080
6Ne998BINARY-866
7Column0280
8Ne10148NOCASE-882
9Column01120
10Function5118like(3)0
11If81410
12Rowid0200
13Insert1120
14Next0501
15OpenWrite01050
16Rewind13000
17Rowid1200
18NotExists02920
19Column0030
20Column0140
21Column0250
22Column0360
23Column00160
24Column01170
25Column04180
26Function113157sqlite_rename_table(7)0
27MakeRecord3514BBBDB0
28Insert01420
29Next11700
30Null022230
31OpenEphemeral30220
32OpenRead21030
33Rewind24500
34Column2280
35Ne10448NOCASE-882
36Column2080
37Eq29428BINARY-866
38Column2080
39Eq9428BINARY-866
40Column2080
41Ne30448BINARY-882
42Rowid22300
43Insert322230
44Next23401
45OpenWrite21050
46Rewind37000
47Rowid32300
48NotExists269230
49Column20240
50Column2080
51Ne29548BINARY-882
52String80250songs0
53Goto06400
54Column21330
55Function5328like(3)0
56IfNot86310
57Column2080
58Ne9638BINARY-882
59Column21360
60Function2368substr(2)0
61Concat835250
62Goto06400
63Column21250
64String80260songs0
65Column23270
66Column24280
67MakeRecord24531BBBDB0
68Insert231230
69Next34700
70Null038390
71OpenEphemeral50380
72OpenRead415010
73Rewind47900
74Column4080
75Ne10788BINARY-881
76Rowid43900
77Insert538390
78Next47401
79OpenWrite415020
80Rewind58800
81Rowid53900
82NotExists487390
83String80400songs0
84Column41410
85MakeRecord402420
86Insert442390
87Next58100
88Null043440
89OpenEphemeral70430
90OpenRead61110
91Rewind69800
92Column6080
93Eq89550BINARY-866
94Ne89730BINARY-882
95Rowid64400
96Insert743440
97Next69201
98OpenWrite61150
99Rewind712200
100Rowid74400
101NotExists6121440
102Column60450
103Column61460
104Column62520
105Ne1011352NOCASE-882
106Column64540
107Column60550
108Column61560
109Function1135352sqlite_rename_test(7)0
110IfNot5211310
111String80470songs0
112Goto011400
113Column62470
114Column63480
115Column60610
116Column61620
117Column64630
118Function1136049sqlite_rename_table(7)0
119MakeRecord45551BBBDB0
120Insert651440
121Next710000
122String80670songs0
123VRename6700vtab:52B1500
124SetCookie0120
125ParseSchema0001
126ParseSchema1001
127OpenRead81050
128Rewind814300
129Column81690
130Function56852like(3)0
131If5214210
132Column84720
133Function17152like(2)0
134If5214210
135Column84740
136Column80750
137Column81760
138Function1137352sqlite_rename_test(7)0
139Ne801425280
140Integer18100
141ResultRow81100
142Next812901
143OpenRead91150
144Rewind915900
145Column91830
146Function58252like(3)0
147If5215810
148Column94860
149Function18552like(2)0
150If5215810
151Column94880
152Column90890
153Column91900
154Function1138752sqlite_rename_test(7)0
155Ne801585280
156Integer19400
157ResultRow94100
158Next914501
159Halt0000
160Transaction01101
161Transaction11001
162String8090index0
163String80100lyrics0
164String80110sqliteX_%0
165String80130X0
166String80150main0
167String80190lyrics0
168String80200songs0
169Integer02100
170String80290table0
171String80300trigger0
172String80320sqliteX_autoindex%0
173String80340X0
174String80520sqlite_autoindex_0
175String80950songs0
176Concat9552350
177Integer69500
178Integer185200
179Add5295370
180String80500view0
181String80530main0
182Integer15700
183String80580after rename0
184Integer05900
185String80600main0
186String80640lyrics0
187String80650songs0
188Integer16600
189String80680sqliteX_%0
190String80700X0
191String80710create virtual%0
192String80730main0
193Integer07700
194String80780after rename0
195Integer07900
196Null08000
197String80820sqliteX_%0
198String80840X0
199String80850create virtual%0
200String80870main0
201Integer19100
202String80920after rename0
203Integer09300
204Goto0100

Open it in the EXPLAIN visualizer →

Also in this program: Add, Column, Concat, Eq, Function, Goto, Halt, If, IfNot, Init, Insert, Integer, MakeRecord, Ne, Next, NotExists, Null, OpenEphemeral, OpenRead, OpenWrite, ParseSchema, ResultRow, Rewind, Rowid, SetCookie, String8, Transaction.

What the SQLite documentation says

P4 is a pointer to a virtual table object, an sqlite3_vtab structure. This opcode invokes the corresponding xRename method. The value in register P1 is passed as the zName argument to the xRename method.

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.

← VOpen · VUpdate →