Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Move the sqlite3_exec() function to legacy.c. (CVS 1455) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9385ad5ca82c82d9ef699102ca0b5366 |
User & Date: | danielk1977 2004-05-25 23:35:18.000 |
Context
2004-05-26
| ||
00:01 | Add file legacy.c with old APIs. (CVS 1456) (check-in: ae18fcb7ad user: danielk1977 tags: trunk) | |
2004-05-25
| ||
23:35 | Move the sqlite3_exec() function to legacy.c. (CVS 1455) (check-in: 9385ad5ca8 user: danielk1977 tags: trunk) | |
12:05 | Change a couple of symbol names for the new user function API. (CVS 1454) (check-in: 8f6b20c293 user: danielk1977 tags: trunk) | |
Changes
Changes to main.mk.
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | - + | # Object files for the SQLite library. # LIBOBJ = attach.o auth.o btree.o build.o copy.o date.o delete.o \ expr.o func.o hash.o insert.o \ main.o opcodes.o os_mac.o os_unix.o os_win.o \ pager.o parse.o pragma.o printf.o random.o \ select.o table.o tokenize.o trigger.o update.o util.o \ |
︙ | |||
236 237 238 239 240 241 242 243 244 245 246 247 248 249 | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | + + | hash.o: $(TOP)/src/hash.c $(HDR) $(TCCX) -c $(TOP)/src/hash.c insert.o: $(TOP)/src/insert.c $(HDR) $(TCCX) -c $(TOP)/src/insert.c legacy.o: $(TOP)/src/legacy.c $(HDR) $(TCCX) -c $(TOP)/src/legacy.c 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 |
︙ |
Changes to src/copy.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | /* ** 2003 April 6 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to implement the COPY command. ** |
︙ | |||
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | + | sqlite3VdbeResolveLabel(v, end); sqlite3VdbeAddOp(v, OP_Noop, 0, 0); sqlite3EndWriteOperation(pParse); if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp(v, OP_ColumnName, 0, 1); sqlite3VdbeChangeP3(v, -1, "rows inserted", P3_STATIC); sqlite3VdbeAddOp(v, OP_Callback, 1, 0); sqlite3VdbeSetNumCols(v, 1); } } copy_cleanup: sqlite3SrcListDelete(pTableName); sqliteFree(zFile); return; } |
Changes to src/delete.c.
︙ | |||
8 9 10 11 12 13 14 | 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 C code routines that are called by the parser ** to handle DELETE FROM statements. ** |
︙ | |||
302 303 304 305 306 307 308 309 310 311 312 313 314 315 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | + | /* ** Return the number of rows that were deleted. */ if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp(v, OP_ColumnName, 0, 1); sqlite3VdbeChangeP3(v, -1, "rows deleted", P3_STATIC); sqlite3VdbeAddOp(v, OP_Callback, 1, 0); sqlite3VdbeSetNumCols(v, 1); } delete_from_cleanup: sqlite3AuthContextPop(&sContext); sqlite3SrcListDelete(pTabList); sqlite3ExprDelete(pWhere); return; |
︙ |
Changes to src/insert.c.
︙ | |||
8 9 10 11 12 13 14 | 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 C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** |
︙ | |||
616 617 618 619 620 621 622 623 624 625 626 627 628 629 | 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | + | /* ** Return the number of rows inserted. */ if( db->flags & SQLITE_CountRows ){ sqlite3VdbeOp3(v, OP_ColumnName, 0, 1, "rows inserted", P3_STATIC); sqlite3VdbeAddOp(v, OP_MemLoad, iCntMem, 0); sqlite3VdbeAddOp(v, OP_Callback, 1, 0); sqlite3VdbeSetNumCols(v, 1); } insert_cleanup: sqlite3SrcListDelete(pTabList); if( pList ) sqlite3ExprListDelete(pList); if( pSelect ) sqlite3SelectDelete(pSelect); sqlite3IdListDelete(pColumn); |
︙ |
Changes to src/main.c.
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + | ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** |
︙ | |||
477 478 479 480 481 482 483 | 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | sqlite3BtreeRollback(db->aDb[i].pBt); db->aDb[i].inTrans = 0; } } sqlite3ResetInternalSchema(db, 0); /* sqlite3RollbackInternalChanges(db); */ } |
︙ | |||
1070 1071 1072 1073 1074 1075 1076 | 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 | - + | if( sqlite3SafetyOn(db) ){ rc = SQLITE_MISUSE; goto prepare_out; } if( !db->init.busy ){ if( (db->flags & SQLITE_Initialized)==0 ){ |
︙ | |||
1128 1129 1130 1131 1132 1133 1134 1135 | 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 | + - - - - + + + + + - - + + - | if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; if( sParse.rc==SQLITE_SCHEMA ){ sqlite3ResetInternalSchema(db, 0); } assert( ppStmt ); *ppStmt = (sqlite3_stmt*)sParse.pVdbe; if( pzTail ) *pzTail = sParse.zTail; rc = sParse.rc; |
︙ |
Changes to src/pragma.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | /* ** 2003 April 6 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** |
︙ | |||
125 126 127 128 129 130 131 132 133 134 135 136 137 138 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | + | }; int i; for(i=0; i<sizeof(aPragma)/sizeof(aPragma[0]); i++){ if( sqlite3StrICmp(zLeft, aPragma[i].zName)==0 ){ sqlite *db = pParse->db; Vdbe *v; if( strcmp(zLeft,zRight)==0 && (v = sqlite3GetVdbe(pParse))!=0 ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeOp3(v, OP_ColumnName, 0, 1, aPragma[i].zName, P3_STATIC); sqlite3VdbeOp3(v, OP_ColumnName, 1, 0, "boolean", P3_STATIC); sqlite3VdbeCode(v, OP_Integer, (db->flags & aPragma[i].mask)!=0, 0, OP_Callback, 1, 0, 0); }else if( getBoolean(zRight) ){ db->flags |= aPragma[i].mask; |
︙ | |||
203 204 205 206 207 208 209 210 211 212 213 214 215 216 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | + | { OP_Ne, 0, 6, 0}, { OP_Integer, 0, 0, 0}, /* 5 */ { OP_ColumnName, 0, 1, "cache_size"}, { OP_Callback, 1, 0, 0}, }; int addr; if( pRight->z==pLeft->z ){ sqlite3VdbeSetNumCols(v, 1); addr = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); sqlite3VdbeChangeP1(v, addr+5, MAX_PAGES); }else{ int size = atoi(zRight); if( size<0 ) size = -size; sqlite3BeginWriteOperation(pParse, 0, 0); sqlite3VdbeAddOp(v, OP_Integer, size, 0); |
︙ | |||
244 245 246 247 248 249 250 251 252 253 254 255 256 257 | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | + | { OP_ColumnName, 0, 1, "cache_size"}, { OP_Callback, 1, 0, 0}, }; if( pRight->z==pLeft->z ){ int size = db->cache_size;; if( size<0 ) size = -size; sqlite3VdbeAddOp(v, OP_Integer, size, 0); sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); }else{ int size = atoi(zRight); if( size<0 ) size = -size; if( db->cache_size<0 ) size = -size; db->cache_size = size; sqlite3BtreeSetCacheSize(db->aDb[0].pBt, db->cache_size); |
︙ | |||
289 290 291 292 293 294 295 296 297 298 299 300 301 302 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | + | { OP_AddImm, 1, 0, 0}, { OP_Callback, 1, 0, 0}, { OP_Halt, 0, 0, 0}, { OP_AddImm, -1, 0, 0}, /* 10 */ { OP_Callback, 1, 0, 0} }; if( pRight->z==pLeft->z ){ sqlite3VdbeSetNumCols(v, 1); int addr = sqlite3VdbeAddOpList(v, ArraySize(getSync), getSync); sqlite3VdbeChangeP2(v, addr+3, addr+10); }else{ int addr; int size = db->cache_size; if( size<0 ) size = -size; sqlite3BeginWriteOperation(pParse, 0, 0); |
︙ | |||
332 333 334 335 336 337 338 339 340 341 342 343 344 345 | 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | + | */ if( sqlite3StrICmp(zLeft,"synchronous")==0 ){ static VdbeOpList getSync[] = { { OP_ColumnName, 0, 1, "synchronous"}, { OP_Callback, 1, 0, 0}, }; if( pRight->z==pLeft->z ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeAddOp(v, OP_Integer, db->safety_level-1, 0); sqlite3VdbeAddOpList(v, ArraySize(getSync), getSync); }else{ int size = db->cache_size; if( size<0 ) size = -size; db->safety_level = getSafetyLevel(zRight)+1; if( db->safety_level==1 ) size = -size; |
︙ | |||
372 373 374 375 376 377 378 379 380 381 382 383 384 385 | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | + | { OP_ColumnName, 1, 0, "name"}, { OP_ColumnName, 2, 0, "type"}, { OP_ColumnName, 3, 0, "notnull"}, { OP_ColumnName, 4, 0, "dflt_value"}, { OP_ColumnName, 5, 1, "pk"}, }; int i; sqlite3VdbeSetNumCols(v, 6); sqlite3VdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); sqlite3ViewGetColumnNames(pParse, pTab); for(i=0; i<pTab->nCol; i++){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zName, 0); sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[i].zType ? pTab->aCol[i].zType : "numeric", 0); |
︙ | |||
400 401 402 403 404 405 406 407 408 409 410 411 412 413 | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | + | static VdbeOpList tableInfoPreface[] = { { OP_ColumnName, 0, 0, "seqno"}, { OP_ColumnName, 1, 0, "cid"}, { OP_ColumnName, 2, 1, "name"}, }; int i; pTab = pIdx->pTable; sqlite3VdbeSetNumCols(v, 3); sqlite3VdbeAddOpList(v, ArraySize(tableInfoPreface), tableInfoPreface); for(i=0; i<pIdx->nColumn; i++){ int cnum = pIdx->aiColumn[i]; sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeAddOp(v, OP_Integer, cnum, 0); assert( pTab->nCol>cnum ); sqlite3VdbeOp3(v, OP_String, 0, 0, pTab->aCol[cnum].zName, 0); |
︙ | |||
428 429 430 431 432 433 434 435 436 437 438 439 440 441 | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | + | int i = 0; static VdbeOpList indexListPreface[] = { { OP_ColumnName, 0, 0, "seq"}, { OP_ColumnName, 1, 0, "name"}, { OP_ColumnName, 2, 1, "unique"}, }; sqlite3VdbeSetNumCols(v, 3); sqlite3VdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); while(pIdx){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeOp3(v, OP_String, 0, 0, pIdx->zName, 0); sqlite3VdbeAddOp(v, OP_Integer, pIdx->onError!=OE_None, 0); sqlite3VdbeAddOp(v, OP_Callback, 3, 0); ++i; |
︙ | |||
458 459 460 461 462 463 464 465 466 467 468 469 470 471 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | + | { OP_ColumnName, 0, 0, "id"}, { OP_ColumnName, 1, 0, "seq"}, { OP_ColumnName, 2, 0, "table"}, { OP_ColumnName, 3, 0, "from"}, { OP_ColumnName, 4, 1, "to"}, }; sqlite3VdbeSetNumCols(v, 6); sqlite3VdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); while(pFK){ int j; for(j=0; j<pFK->nCol; j++){ sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeAddOp(v, OP_Integer, j, 0); sqlite3VdbeOp3(v, OP_String, 0, 0, pFK->zTo, 0); |
︙ | |||
484 485 486 487 488 489 490 491 492 493 494 495 496 497 | 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | + | int i; static VdbeOpList indexListPreface[] = { { OP_ColumnName, 0, 0, "seq"}, { OP_ColumnName, 1, 0, "name"}, { OP_ColumnName, 2, 1, "file"}, }; sqlite3VdbeSetNumCols(v, 3); sqlite3VdbeAddOpList(v, ArraySize(indexListPreface), indexListPreface); for(i=0; i<db->nDb; i++){ if( db->aDb[i].pBt==0 ) continue; assert( db->aDb[i].zName!=0 ); sqlite3VdbeAddOp(v, OP_Integer, i, 0); sqlite3VdbeOp3(v, OP_String, 0, 0, db->aDb[i].zName, 0); sqlite3VdbeOp3(v, OP_String, 0, 0, |
︙ | |||
515 516 517 518 519 520 521 522 523 524 525 526 527 528 | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | + | if( sqlite3StrICmp(zLeft, "temp_store")==0 ){ static VdbeOpList getTmpDbLoc[] = { { OP_ColumnName, 0, 1, "temp_store"}, { OP_Callback, 1, 0, 0}, }; if( pRight->z==pLeft->z ){ sqlite3VdbeAddOp(v, OP_Integer, db->temp_store, 0); sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeAddOpList(v, ArraySize(getTmpDbLoc), getTmpDbLoc); }else{ changeTempStorage(pParse, zRight); } }else /* |
︙ | |||
538 539 540 541 542 543 544 545 546 547 548 549 550 551 | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | + | */ if( sqlite3StrICmp(zLeft, "default_temp_store")==0 ){ static VdbeOpList getTmpDbLoc[] = { { OP_ColumnName, 0, 1, "temp_store"}, { OP_ReadCookie, 0, 5, 0}, { OP_Callback, 1, 0, 0}}; if( pRight->z==pLeft->z ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeAddOpList(v, ArraySize(getTmpDbLoc), getTmpDbLoc); }else{ sqlite3BeginWriteOperation(pParse, 0, 0); sqlite3VdbeAddOp(v, OP_Integer, getTempStore(zRight), 0); sqlite3VdbeAddOp(v, OP_SetCookie, 0, 5); sqlite3EndWriteOperation(pParse); } |
︙ | |||
583 584 585 586 587 588 589 590 591 592 593 594 595 596 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | + | { OP_Integer, 0, 0, 0}, { OP_Ne, 0, 0, 0}, /* 2 */ { OP_String, 0, 0, "ok"}, { OP_Callback, 1, 0, 0}, }; /* Initialize the VDBE program */ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeAddOpList(v, ArraySize(initCode), initCode); /* Do an integrity check on each database file */ for(i=0; i<db->nDb; i++){ HashElem *x; int cnt = 0; |
︙ |
Changes to src/select.c.
︙ | |||
8 9 10 11 12 13 14 | 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 C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** |
︙ | |||
683 684 685 686 687 688 689 690 691 692 693 694 695 696 | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | + | int fullNames, shortNames; assert( v!=0 ); if( pParse->colNamesSet || v==0 || sqlite3_malloc_failed ) return; pParse->colNamesSet = 1; fullNames = (db->flags & SQLITE_FullColNames)!=0; shortNames = (db->flags & SQLITE_ShortColNames)!=0; sqlite3VdbeSetNumCols(v, pEList->nExpr); for(i=0; i<pEList->nExpr; i++){ Expr *p; int p2 = i==pEList->nExpr-1; p = pEList->a[i].pExpr; if( p==0 ) continue; if( pEList->a[i].zName ){ char *zName = pEList->a[i].zName; |
︙ |
Changes to src/sqlite.h.in.
︙ | |||
8 9 10 11 12 13 14 | 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 header file defines the interface that the SQLite library ** presents to client programs. ** |
︙ | |||
1055 1056 1057 1058 1059 1060 1061 | 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 | - + | ** The first parameter is a compiled SQL statement. If this statement ** is a SELECT statement, the Nth column of the returned result set ** of the SELECT is a table column then the declared type of the table ** column is returned. If the Nth column of the result set is not at table ** column, then a NULL pointer is returned. The returned string is always ** UTF-8 encoded. For example, in the database schema: ** |
︙ |
Changes to src/test1.c.
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | - + | ** May you share freely, never taking more than you give. ** ************************************************************************* ** Code for testing the printf() interface to SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** |
︙ | |||
760 761 762 763 764 765 766 767 768 769 770 771 772 773 | 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 | + | /* ** Usage: sqlite3_step VM ?NVAR? ?VALUEVAR? ?COLNAMEVAR? ** ** Step a virtual machine. Return a the result code as a string. ** Column results are written into three variables. */ #if 0 static int test_step( void *NotUsed, Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int argc, /* Number of arguments */ char **argv /* Text of each argument */ ){ sqlite_vm *vm; |
︙ | |||
813 814 815 816 817 818 819 820 821 822 823 824 825 826 | 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 | + | case SQLITE_ERROR: zRc = "SQLITE_ERROR"; break; case SQLITE_MISUSE: zRc = "SQLITE_MISUSE"; break; default: zRc = "unknown"; break; } Tcl_AppendResult(interp, zRc, 0); return TCL_OK; } #endif /* ** Usage: sqlite3_finalize STMT ** ** Finalize a statement handle. */ static int test_finalize( |
︙ | |||
1558 1559 1560 1561 1562 1563 1564 | 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 | - - + - - | Tcl_CmdProc *xProc; } aCmd[] = { { "sqlite3_mprintf_int", (Tcl_CmdProc*)sqlite3_mprintf_int }, { "sqlite3_mprintf_str", (Tcl_CmdProc*)sqlite3_mprintf_str }, { "sqlite3_mprintf_double", (Tcl_CmdProc*)sqlite3_mprintf_double }, { "sqlite3_mprintf_scaled", (Tcl_CmdProc*)sqlite3_mprintf_scaled }, { "sqlite3_mprintf_z_test", (Tcl_CmdProc*)test_mprintf_z }, |
︙ |
Changes to src/update.c.
︙ | |||
8 9 10 11 12 13 14 | 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 C code routines that are called by the parser ** to handle UPDATE statements. ** |
︙ | |||
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | + | /* ** Return the number of rows that were changed. */ if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ sqlite3VdbeOp3(v, OP_ColumnName, 0, 1, "rows updated", P3_STATIC); sqlite3VdbeAddOp(v, OP_Callback, 1, 0); sqlite3VdbeSetNumCols(v, 1); } update_cleanup: sqlite3AuthContextPop(&sContext); sqliteFree(apIdx); sqliteFree(aXRef); sqlite3SrcListDelete(pTabList); sqlite3ExprListDelete(pChanges); sqlite3ExprDelete(pWhere); return; } |
Changes to src/vdbe.c.
︙ | |||
39 40 41 42 43 44 45 | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | - + | ** ** Various scripts scan this source file in order to generate HTML ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** |
︙ | |||
523 524 525 526 527 528 529 530 531 532 533 534 535 536 | 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | + | ** ** SQLITE_MISUSE means that the this routine was called inappropriately. ** Perhaps it was called on a virtual machine that had already been ** finalized or on one that had previously returned SQLITE_ERROR or ** SQLITE_DONE. Or it could be the case the the same database connection ** is being used simulataneously by two or more threads. */ #if 0 int sqlite3_step( sqlite_vm *pVm, /* The virtual machine to execute */ int *pN, /* OUT: Number of columns in result */ const char ***pazValue, /* OUT: Column data */ const char ***pazColName /* OUT: Column names and datatypes */ ){ sqlite3_stmt *pStmt = (sqlite3_stmt*)pVm; |
︙ | |||
564 565 566 567 568 569 570 571 572 573 574 575 576 577 | 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | + | (*pazValue)[i] = sqlite3_column_data(pStmt, i); } } } return rc; } #endif /* ** Execute the statement pStmt, either until a row of data is ready, the ** statement is completely executed or an error occurs. */ int sqlite3_step_new(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe*)pStmt; |
︙ | |||
2086 2087 2088 2089 2090 2091 2092 | 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 | + - + | ** number of columns specified in OP_Callback must one more than the P1 ** value of the OP_ColumnName that has P2==1. */ case OP_ColumnName: { assert( pOp->p1>=0 && pOp->p1<p->nOp ); p->azColName[pOp->p1] = pOp->p3; p->nCallback = 0; assert( !pOp->p2 || p->nResColumn==(pOp->p1+1) ); |
︙ | |||
2343 2344 2345 2346 2347 2348 2349 | 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 | - + | ** Pop all arguments from the stack and push back the result. ** ** See also: AggFunc */ case OP_Function: { int i; Mem *pArg; |
︙ | |||
5689 5690 5691 5692 5693 5694 5695 | 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 | - + | ** Ideally, this index would be another parameter, but there are ** no free parameters left. The integer is popped from the stack. */ case OP_AggFunc: { int n = pOp->p2; int i; Mem *pMem, *pRec; |
︙ | |||
5836 5837 5838 5839 5840 5841 5842 | 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 | - + | }else{ p->agg.pSearch = sqliteHashNext(p->agg.pSearch); } if( p->agg.pSearch==0 ){ pc = pOp->p2 - 1; } else { int i; |
︙ |
Changes to src/vdbe.h.
︙ | |||
11 12 13 14 15 16 17 | 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. ** |
︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | + | int sqlite3VdbeFinalize(Vdbe*,char**); void sqlite3VdbeResolveLabel(Vdbe*, int); int sqlite3VdbeCurrentAddr(Vdbe*); void sqlite3VdbeTrace(Vdbe*,FILE*); void sqlite3VdbeCompressSpace(Vdbe*,int); int sqlite3VdbeReset(Vdbe*,char **); int sqliteVdbeSetVariables(Vdbe*,int,const char**); void sqlite3VdbeSetNumCols(Vdbe*,int); #ifndef NDEBUG void sqlite3VdbeComment(Vdbe*, const char*, ...); # define VdbeComment(X) sqlite3VdbeComment X #else # define VdbeComment(X) #endif #endif |
Changes to src/vdbeaux.c.
︙ | |||
861 862 863 864 865 866 867 868 869 870 871 872 873 874 | 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | + + + + + + + + + + | p->keylistStack = 0; } sqliteFree(p->contextStack); p->contextStack = 0; sqliteFree(p->zErrMsg); p->zErrMsg = 0; } /* ** Set the number of result columns that will be returned by this SQL ** statement. This is now set at compile time, rather than during ** execution of the vdbe program so that sqlite3_column_count() can ** be called on an SQL statement before sqlite3_step(). */ void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){ p->nResColumn = nResColumn; } /* ** Clean up a VDBE after execution but do not delete the VDBE just yet. ** Write any error messages into *pzErrMsg. Return the result code. ** ** After this routine is run, the VDBE should be ready to be executed ** again. |
︙ |