Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Modify the build process so that the VDBE opcode numbers and the table that contains the opcode names are both automatically generated. This makes it much easier to create new VDBE opcodes. (CVS 746) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
eb54d455b0325d3be96daf6c220c4ee3 |
User & Date: | drh 2002-09-08 00:04:51.000 |
Context
2002-09-08
| ||
00:04 | Modify the build process so that the VDBE opcode numbers and the table that contains the opcode names are both automatically generated. This makes it much easier to create new VDBE opcodes. (CVS 1727) (check-in: c4f0bb0238 user: drh tags: trunk) | |
00:04 | Modify the build process so that the VDBE opcode numbers and the table that contains the opcode names are both automatically generated. This makes it much easier to create new VDBE opcodes. (CVS 746) (check-in: eb54d455b0 user: drh tags: trunk) | |
2002-09-05
| ||
23:21 | Fix a memory leak that occurred when sqlite_open() failed. (CVS 745) (check-in: a876021304 user: drh tags: trunk) | |
Changes
Changes to Makefile.in.
︙ | ︙ | |||
59 60 61 62 63 64 65 | # You should not have to change anything below this line ############################################################################### # Object files for the SQLite library. # LIBOBJ = btree.lo build.lo delete.lo expr.lo func.lo hash.lo insert.lo \ | | | > > > | < > > > > > > > > > > > > | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | # You should not have to change anything below this line ############################################################################### # Object files for the SQLite library. # LIBOBJ = btree.lo build.lo delete.lo expr.lo func.lo hash.lo insert.lo \ main.lo opcodes.lo os.lo pager.lo parse.lo printf.lo random.lo \ select.lo table.lo tokenize.lo update.lo util.lo vdbe.lo \ where.lo trigger.lo # All of the source code files. # SRC = \ $(TOP)/src/btree.c \ $(TOP)/src/btree.h \ $(TOP)/src/build.c \ $(TOP)/src/delete.c \ $(TOP)/src/expr.c \ $(TOP)/src/func.c \ $(TOP)/src/hash.c \ $(TOP)/src/hash.h \ $(TOP)/src/insert.c \ $(TOP)/src/main.c \ $(TOP)/src/os.c \ $(TOP)/src/pager.c \ $(TOP)/src/pager.h \ $(TOP)/src/parse.y \ $(TOP)/src/printf.c \ $(TOP)/src/random.c \ $(TOP)/src/select.c \ $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/table.c \ $(TOP)/src/tclsqlite.c \ $(TOP)/src/tokenize.c \ $(TOP)/src/trigger.c \ $(TOP)/src/update.c \ $(TOP)/src/util.c \ $(TOP)/src/vdbe.c \ $(TOP)/src/vdbe.h \ $(TOP)/src/where.c # Source code to the test files. # TESTSRC = \ $(TOP)/src/btree.c \ $(TOP)/src/func.c \ $(TOP)/src/os.c \ $(TOP)/src/pager.c \ $(TOP)/src/test1.c \ $(TOP)/src/test2.c \ $(TOP)/src/test3.c \ $(TOP)/src/md5.c # Header files used by all library source files. # HDR = \ sqlite.h \ $(TOP)/src/btree.h \ $(TOP)/src/hash.h \ opcodes.h \ $(TOP)/src/os.h \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/vdbe.h \ parse.h # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. # all: sqlite.h libsqlite.la sqlite # Generate the file "last_change" which contains the date of change |
︙ | ︙ | |||
128 129 130 131 132 133 134 135 136 137 138 139 140 141 | libtclsqlite.la: tclsqlite.lo libsqlite.la $(LIBTOOL) $(TCC) -o libtclsqlite.la tclsqlite.lo \ libsqlite.la $(LIBTCL) -rpath $(exec_prefix)/lib sqlite: $(TOP)/src/shell.c libsqlite.la sqlite.h $(LIBTOOL) $(TCC) $(READLINE_FLAGS) -o sqlite $(TOP)/src/shell.c \ libsqlite.la $(LIBREADLINE) -rpath $(exec_prefix)/lib # Rules to build the LEMON compiler generator # lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c $(BCC) -o lemon $(TOP)/tool/lemon.c cp $(TOP)/tool/lempar.c . | > > > > > > > > > > > > > < < < < < < < < < < > > > > > > > > > > > > > > > > | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | libtclsqlite.la: tclsqlite.lo libsqlite.la $(LIBTOOL) $(TCC) -o libtclsqlite.la tclsqlite.lo \ libsqlite.la $(LIBTCL) -rpath $(exec_prefix)/lib sqlite: $(TOP)/src/shell.c libsqlite.la sqlite.h $(LIBTOOL) $(TCC) $(READLINE_FLAGS) -o sqlite $(TOP)/src/shell.c \ libsqlite.la $(LIBREADLINE) -rpath $(exec_prefix)/lib # This target creates a directory named "tsrc" and fills it with # copies of all of the C source code and header files needed to # build on the target system. Some of the C source code and header # files are automatically generated. This target takes care of # all that automatic generation. # target_source: $(SRC) $(HDR) rm -rf tsrc mkdir tsrc cp $(SRC) $(HDR) tsrc rm tsrc/sqlite.h.in tsrc/parse.y cp parse.c tsrc # Rules to build the LEMON compiler generator # lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c $(BCC) -o lemon $(TOP)/tool/lemon.c cp $(TOP)/tool/lempar.c . btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h $(LIBTOOL) $(TCC) -c $(TOP)/src/btree.c build.lo: $(TOP)/src/build.c $(HDR) $(LIBTOOL) $(TCC) -c $(TOP)/src/build.c main.lo: $(TOP)/src/main.c $(HDR) $(LIBTOOL) $(TCC) -c $(TOP)/src/main.c pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h $(LIBTOOL) $(TCC) -c $(TOP)/src/pager.c opcodes.lo: opcodes.c $(LIBTOOL) $(TCC) -c opcodes.c opcodes.c: $(TOP)/src/vdbe.c echo '/* Automatically generated file. Do not edit */' >opcodes.c echo 'char *sqliteOpcodeNames[] = { "???", ' >>opcodes.c grep '^case OP_' $(TOP)/src/vdbe.c | \ sed -e 's/^.*OP_/ "/' -e 's/:.*$$/", /' >>opcodes.c echo '};' >>opcodes.c opcodes.h: $(TOP)/src/vdbe.h echo '/* Automatically generated file. Do not edit */' >opcodes.h grep '^case OP_' $(TOP)/src/vdbe.c | \ sed -e 's/://' | \ awk '{printf "#define %-30s %3d\n", $$2, ++cnt}' >>opcodes.h os.lo: $(TOP)/src/os.c $(HDR) $(LIBTOOL) $(TCC) -c $(TOP)/src/os.c parse.lo: parse.c $(HDR) $(LIBTOOL) $(TCC) -c parse.c parse.h: parse.c |
︙ | ︙ | |||
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | speed.html: $(TOP)/www/speed.tcl tclsh $(TOP)/www/speed.tcl >speed.html faq.html: $(TOP)/www/faq.tcl tclsh $(TOP)/www/faq.tcl >faq.html download.html: $(TOP)/www/download.tcl tclsh $(TOP)/www/download.tcl >download.html # Files to be published on the website. # DOC = \ index.html \ sqlite.html \ changes.html \ lang.html \ opcode.html \ arch.html \ arch.png \ vdbe.html \ c_interface.html \ crosscompile.html \ mingw.html \ tclsqlite.html \ download.html \ speed.html \ | > > > > > > > > > > > > > > > > > > > > > | > > > > > > > | | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | speed.html: $(TOP)/www/speed.tcl tclsh $(TOP)/www/speed.tcl >speed.html faq.html: $(TOP)/www/faq.tcl tclsh $(TOP)/www/faq.tcl >faq.html formatchng.html: $(TOP)/www/formatchng.tcl tclsh $(TOP)/www/formatchng.tcl >formatchng.html conflict.html: $(TOP)/www/conflict.tcl tclsh $(TOP)/www/conflict.tcl >conflict.html download.html: $(TOP)/www/download.tcl tclsh $(TOP)/www/download.tcl >download.html omitted.html: $(TOP)/www/omitted.tcl tclsh $(TOP)/www/omitted.tcl >omitted.html datatypes.html: $(TOP)/www/datatypes.tcl tclsh $(TOP)/www/datatypes.tcl >datatypes.html quickstart.html: $(TOP)/www/quickstart.tcl tclsh $(TOP)/www/quickstart.tcl >quickstart.html fileformat.html: $(TOP)/www/fileformat.tcl tclsh $(TOP)/www/fileformat.tcl >fileformat.html nulls.html: $(TOP)/www/nulls.tcl tclsh $(TOP)/www/nulls.tcl >nulls.html # Files to be published on the website. # DOC = \ index.html \ sqlite.html \ changes.html \ lang.html \ opcode.html \ arch.html \ arch.png \ vdbe.html \ c_interface.html \ crosscompile.html \ mingw.html \ tclsqlite.html \ download.html \ speed.html \ faq.html \ formatchng.html \ conflict.html \ omitted.html \ datatypes.html \ quickstart.html \ fileformat.html \ nulls.html doc: $(DOC) mkdir -p doc mv $(DOC) doc install: sqlite libsqlite.la sqlite.h $(INSTALL) -d $(exec_prefix)/lib $(LIBTOOL) $(INSTALL) libsqlite.la $(exec_prefix)/lib $(INSTALL) -d $(exec_prefix)/bin $(LIBTOOL) $(INSTALL) sqlite $(exec_prefix)/bin $(INSTALL) -d $(prefix)/include $(INSTALL) -m 0644 sqlite.h $(prefix)/include clean: rm -f *.lo *.la *.o sqlite libsqlite.la sqlite.h opcodes.* rm -rf .libs .deps rm -f lemon lempar.c parse.* sqlite*.tar.gz rm -f $(PUBLISH) rm -f *.da *.bb *.bbg gmon.out rm -f testfixture test.db rm -rf doc distclean: clean rm -f config.log config.status |
Changes to main.mk.
︙ | ︙ | |||
50 51 52 53 54 55 56 | # This is how we compile # TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src # Object files for the SQLite library. # | | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | # This is how we compile # TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src # Object files for the SQLite library. # LIBOBJ = btree.o build.o delete.o expr.o func.o hash.o insert.o main.o \ opcodes.o os.o pager.o parse.o printf.o random.o select.o table.o \ tokenize.o trigger.o update.o util.o vdbe.o where.o tclsqlite.o # All of the source code files. # SRC = \ $(TOP)/src/btree.c \ $(TOP)/src/btree.h \ |
︙ | ︙ | |||
105 106 107 108 109 110 111 112 113 114 115 116 117 118 | # Header files used by all library source files. # HDR = \ sqlite.h \ $(TOP)/src/btree.h \ $(TOP)/src/hash.h \ $(TOP)/src/os.h \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/vdbe.h \ parse.h # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. | > | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | # Header files used by all library source files. # HDR = \ sqlite.h \ $(TOP)/src/btree.h \ $(TOP)/src/hash.h \ opcodes.h \ $(TOP)/src/os.h \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/vdbe.h \ parse.h # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. |
︙ | ︙ | |||
161 162 163 164 165 166 167 168 169 170 171 172 173 174 | main.o: $(TOP)/src/main.c $(HDR) $(TCCX) -c $(TOP)/src/main.c pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h $(TCCX) -c $(TOP)/src/pager.c os.o: $(TOP)/src/os.c $(HDR) $(TCCX) -c $(TOP)/src/os.c parse.o: parse.c $(HDR) $(TCCX) -c parse.c parse.h: parse.c | > > > > > > > > > > > > > > > > | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | main.o: $(TOP)/src/main.c $(HDR) $(TCCX) -c $(TOP)/src/main.c pager.o: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h $(TCCX) -c $(TOP)/src/pager.c opcodes.o: opcodes.c $(TCCX) -c opcodes.c opcodes.c: $(TOP)/src/vdbe.c echo '/* Automatically generated file. Do not edit */' >opcodes.c echo 'char *sqliteOpcodeNames[] = { "???", ' >>opcodes.c grep '^case OP_' $(TOP)/src/vdbe.c | \ sed -e 's/^.*OP_/ "/' -e 's/:.*$$/", /' >>opcodes.c echo '};' >>opcodes.c opcodes.h: $(TOP)/src/vdbe.h echo '/* Automatically generated file. Do not edit */' >opcodes.h grep '^case OP_' $(TOP)/src/vdbe.c | \ sed -e 's/://' | \ awk '{printf "#define %-30s %3d\n", $$2, ++cnt}' >>opcodes.h os.o: $(TOP)/src/os.c $(HDR) $(TCCX) -c $(TOP)/src/os.c parse.o: parse.c $(HDR) $(TCCX) -c parse.c parse.h: parse.c |
︙ | ︙ | |||
344 345 346 347 348 349 350 | install: sqlite libsqlite.a sqlite.h mv sqlite /usr/bin mv libsqlite.a /usr/lib mv sqlite.h /usr/include clean: | | | 361 362 363 364 365 366 367 368 369 370 371 372 | install: sqlite libsqlite.a sqlite.h mv sqlite /usr/bin mv libsqlite.a /usr/lib mv sqlite.h /usr/include clean: rm -f *.o sqlite libsqlite.a sqlite.h opcodes.* rm -f lemon lempar.c parse.* sqlite*.tar.gz rm -f $(PUBLISH) rm -f *.da *.bb *.bbg gmon.out rm -rf tsrc |
Changes to src/expr.c.
︙ | ︙ | |||
8 9 10 11 12 13 14 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** ** $Id: expr.c,v 1.81 2002/09/08 00:04:52 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** Construct a new expression node and return a pointer to it. Memory ** for this node is obtained from sqliteMalloc(). The calling function |
︙ | ︙ | |||
1365 1366 1367 1368 1369 1370 1371 | case TK_LT: case TK_LE: case TK_GT: case TK_GE: case TK_NE: case TK_EQ: { if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ | > > > > > > | | 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 | case TK_LT: case TK_LE: case TK_GT: case TK_GE: case TK_NE: case TK_EQ: { if( pParse->db->file_format>=4 && sqliteExprType(pExpr)==SQLITE_SO_TEXT ){ /* Convert numeric comparison opcodes into text comparison opcodes. ** This step depends on the fact that the text comparision opcodes are ** always 6 greater than their corresponding numeric comparison ** opcodes. */ assert( OP_Eq+6 == OP_StrEq ); op += 6; } sqliteExprCode(pParse, pExpr->pLeft); sqliteExprCode(pParse, pExpr->pRight); sqliteVdbeAddOp(v, op, jumpIfNull, dest); break; } case TK_ISNULL: |
︙ | ︙ |
Changes to src/vdbe.c.
︙ | ︙ | |||
26 27 28 29 30 31 32 | ** type to the other occurs as necessary. ** ** Most of the code in this file is taken up by the sqliteVdbeExec() ** function which does the work of interpreting a VDBE program. ** But other routines are also provided to help in building up ** a program instruction by instruction. ** | | > > > > > > > > | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ** type to the other occurs as necessary. ** ** Most of the code in this file is taken up by the sqliteVdbeExec() ** function which does the work of interpreting a VDBE program. ** But other routines are also provided to help in building up ** a program instruction by instruction. ** ** $Id: vdbe.c,v 1.176 2002/09/08 00:04:52 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> /* ** The makefile scans this source file and creates the following ** array of string constants which are the names of all VDBE opcodes. ** This array is defined in a separate source code file named opcode.c ** which is automatically generated by the makefile. */ extern char *sqliteOpcodeNames[]; /* ** The following global variable is incremented every time a cursor ** moves, either by the OP_MoveTo or the OP_Next opcode. The test ** procedures use this information to make sure that indices are ** working correctly. */ int sqlite_search_count = 0; |
︙ | ︙ | |||
1062 1063 1064 1065 1066 1067 1068 | sqliteFree(p->aOp); sqliteFree(p->aLabel); sqliteFree(p->aStack); sqliteFree(p->zStack); sqliteFree(p); } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 | sqliteFree(p->aOp); sqliteFree(p->aLabel); sqliteFree(p->aStack); sqliteFree(p->zStack); sqliteFree(p); } /* ** Give a listing of the program in the virtual machine. ** ** The interface is the same as sqliteVdbeExec(). But instead of ** running the code, it invokes the callback once for each instruction. ** This feature is used to implement "EXPLAIN". */ |
︙ | ︙ | |||
1171 1172 1173 1174 1175 1176 1177 | sprintf(zP2,"%d", p->aOp[i].p2); if( p->aOp[i].p3type==P3_POINTER ){ sprintf(zP3, "ptr(%#x)", (int)p->aOp[i].p3); azValue[4] = zP3; }else{ azValue[4] = p->aOp[i].p3; } | | | 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 | sprintf(zP2,"%d", p->aOp[i].p2); if( p->aOp[i].p3type==P3_POINTER ){ sprintf(zP3, "ptr(%#x)", (int)p->aOp[i].p3); azValue[4] = zP3; }else{ azValue[4] = p->aOp[i].p3; } azValue[1] = sqliteOpcodeNames[p->aOp[i].opcode]; if( sqliteSafetyOff(db) ){ rc = SQLITE_MISUSE; break; } if( xCallback(pArg, 5, azValue, azColumnNames) ){ rc = SQLITE_ABORT; } |
︙ | ︙ | |||
1306 1307 1308 1309 1310 1311 1312 | sprintf(zPtr, "ptr(%#x)", (int)pOp->p3); zP3 = zPtr; }else{ zP3 = pOp->p3; } if( pOut==0 ) pOut = stdout; fprintf(pOut,"%4d %-12s %4d %4d %s\n", | | | 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 | sprintf(zPtr, "ptr(%#x)", (int)pOp->p3); zP3 = zPtr; }else{ zP3 = pOp->p3; } if( pOut==0 ) pOut = stdout; fprintf(pOut,"%4d %-12s %4d %4d %s\n", pc, sqliteOpcodeNames[pOp->opcode], pOp->p1, pOp->p2, zP3 ? zP3 : ""); fflush(pOut); } #endif /* ** Make sure there is space in the Vdbe structure to hold at least ** mxCursor cursors. If there is not currently enough space, then |
︙ | ︙ | |||
2279 2280 2281 2282 2283 2284 2285 | }else{ p->tos++; aStack[nos].flags = STK_Int; aStack[nos].i = c; } break; } | | > > > > > > > > > > > | 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 | }else{ p->tos++; aStack[nos].flags = STK_Int; aStack[nos].i = c; } break; } /* INSERT NO CODE HERE! ** ** The opcode numbers are extracted from this source file by doing ** ** grep '^case OP_' vdbe.c | ... >opcodes.h ** ** The opcodes are numbered in the order that they appear in this file. ** But in order for the expression generating code to work right, the ** string comparison operators that follow must be numbered exactly 6 ** greater than the numeric comparison opcodes above. So no other ** cases can appear between the two. */ /* Opcode: StrEq P1 P2 * ** ** Pop the top two elements from the stack. If they are equal, then ** jump to instruction P2. Otherwise, continue to the next instruction. ** ** If either operand is NULL (and thus if the result is unknown) then ** take the jump if P1 is true. |
︙ | ︙ | |||
2399 2400 2401 2402 2403 2404 2405 2406 | aStack[nos].flags = STK_Null; } break; }else{ if( Stringify(p, tos) || Stringify(p, nos) ) goto no_mem; c = strcmp(zStack[nos], zStack[tos]); } switch( pOp->opcode ){ | > > > > > | | | | | | | 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 | aStack[nos].flags = STK_Null; } break; }else{ if( Stringify(p, tos) || Stringify(p, nos) ) goto no_mem; c = strcmp(zStack[nos], zStack[tos]); } /* The asserts on each case of the following switch are there to verify ** that string comparison opcodes are always exactly 6 greater than the ** corresponding numeric comparison opcodes. The code generator depends ** on this fact. */ switch( pOp->opcode ){ case OP_StrEq: c = c==0; assert( pOp->opcode-6==OP_Eq ); break; case OP_StrNe: c = c!=0; assert( pOp->opcode-6==OP_Ne ); break; case OP_StrLt: c = c<0; assert( pOp->opcode-6==OP_Lt ); break; case OP_StrLe: c = c<=0; assert( pOp->opcode-6==OP_Le ); break; case OP_StrGt: c = c>0; assert( pOp->opcode-6==OP_Gt ); break; default: c = c>=0; assert( pOp->opcode-6==OP_Ge ); break; } POPSTACK; POPSTACK; if( pOp->p2 ){ if( c ) pc = pOp->p2-1; }else{ p->tos++; |
︙ | ︙ | |||
3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 | zStack[tos] = z; aStack[tos].n = amt; } p->tos = tos; } break; } /* Opcode: Recno P1 * * ** ** Push onto the stack an integer which is the first 4 bytes of the ** the key to the current entry in a sequential scan of the database ** file P1. The sequential scan should have been started using the ** Next opcode. | > > > | 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 | zStack[tos] = z; aStack[tos].n = amt; } p->tos = tos; } break; } /* Opcode: Extract * * * */ /* Opcode: Recno P1 * * ** ** Push onto the stack an integer which is the first 4 bytes of the ** the key to the current entry in a sequential scan of the database ** file P1. The sequential scan should have been started using the ** Next opcode. |
︙ | ︙ |
Changes to src/vdbe.h.
︙ | ︙ | |||
11 12 13 14 15 16 17 | ************************************************************************* ** Header file for the Virtual DataBase Engine (VDBE) ** ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ************************************************************************* ** Header file for the Virtual DataBase Engine (VDBE) ** ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** ** $Id: vdbe.h,v 1.60 2002/09/08 00:04:53 drh Exp $ */ #ifndef _SQLITE_VDBE_H_ #define _SQLITE_VDBE_H_ #include <stdio.h> /* ** A single VDBE is an opaque structure named "Vdbe". Only routines |
︙ | ︙ | |||
55 56 57 58 59 60 61 | ** of a VdbeOp structure into a negative number so that ** sqliteVdbeAddOpList() knows that the address is relative. Calling ** the macro again restores the address. */ #define ADDR(X) (-1-(X)) /* | | | < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | ** of a VdbeOp structure into a negative number so that ** sqliteVdbeAddOpList() knows that the address is relative. Calling ** the macro again restores the address. */ #define ADDR(X) (-1-(X)) /* ** The makefile scans the vdbe.c source file and creates the "opcodes.h" ** header file that defines a number for each opcode used by the VDBE. */ #include "opcodes.h" /* ** Prototypes for the VDBE interface. See comments on the implementation ** for a description of what each of these routines does. */ Vdbe *sqliteVdbeCreate(sqlite*); void sqliteVdbeCreateCallback(Vdbe*, int*); int sqliteVdbeAddOp(Vdbe*,int,int,int); int sqliteVdbeAddOpList(Vdbe*, int nOp, VdbeOp const *aOp); void sqliteVdbeChangeP1(Vdbe*, int addr, int P1); void sqliteVdbeChangeP2(Vdbe*, int addr, int P2); void sqliteVdbeChangeP3(Vdbe*, int addr, const char *zP1, int N); void sqliteVdbeDequoteP3(Vdbe*, int addr); int sqliteVdbeFindOp(Vdbe*, int, int); int sqliteVdbeMakeLabel(Vdbe*); void sqliteVdbeDelete(Vdbe*); int sqliteVdbeExec(Vdbe*,sqlite_callback,void*,char**,void*, int(*)(void*,const char*,int)); int sqliteVdbeList(Vdbe*,sqlite_callback,void*,char**); void sqliteVdbeResolveLabel(Vdbe*, int); int sqliteVdbeCurrentAddr(Vdbe*); void sqliteVdbeTrace(Vdbe*,FILE*); void sqliteVdbeCompressSpace(Vdbe*,int); #endif |
Deleted tool/opNames.awk.
|
| < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tool/renumberOps.awk.
|
| < < < < < < < < < < < < |