Home | History | Annotate | Download | only in dist

Lines Matching defs:Vdbe

7709 ** The maximum number of opcodes in a VDBE program.
8400 ** the VDBE-level file format changes. The following macros define the
8826 ** Defer sourcing vdbe.h and btree.h until after the "u8" and
8827 ** "BusyHandler" typedefs. vdbe.h also requires a few of the opaque
9090 /************** Include vdbe.h in the middle of sqliteInt.h ******************/
9091 /************** Begin file vdbe.h ********************************************/
9103 ** Header file for the Virtual DataBase Engine (VDBE)
9106 ** or VDBE. The VDBE implements an abstract machine that runs a
9114 ** A single VDBE is an opaque structure named "Vdbe". Only routines
9118 typedef struct Vdbe Vdbe;
9221 ** The Vdbe.aColName array contains 5n Mem structures, where n is the
9248 ** The makefile scans the vdbe.c source file and creates the "opcodes.h"
9249 VDBE.
9251 /************** Include opcodes.h in the middle of vdbe.h ********************/
9416 ** comments following the "case" for each opcode in the vdbe.c
9449 /************** Continuing where we left off in vdbe.h ***********************/
9452 ** Prototypes for the VDBE interface. See comments on the implementation
9455 SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse*);
9456 SQLITE_PRIVATE int sqlite3VdbeAddOp0(Vdbe*,int);
9457 SQLITE_PRIVATE int sqlite3VdbeAddOp1(Vdbe*,int,int);
9458 SQLITE_PRIVATE int sqlite3VdbeAddOp2(Vdbe*,int,int,int);
9459 SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int);
9460 SQLITE_PRIVATE int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int);
9461 SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int);
9462 SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp, int iLineno);
9463 SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
9464 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
9465 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
9466 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
9467 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u8 P5);
9468 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
9469 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe*, int addr);
9470 SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op);
9471 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
9473 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
9474 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
9475 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
9476 SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
9477 SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);
9478 SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3*,Vdbe*);
9479 SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe*,Parse*);
9480 SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe*);
9481 SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe*, int);
9482 SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe*);
9484 SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *, int);
9486 SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe*);
9487 SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe*);
9488 SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe*);
9489 SQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe*,int);
9490 SQLITE_PRIVATE int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*));
9491 SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe*);
9492 SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
9493 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int);
9494 SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
9495 SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
9496 SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8);
9497 SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe*, int);
9499 SQLITE_PRIVATE char *sqlite3VdbeExpandSql(Vdbe*, const char*);
9511 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *);
9515 ** each VDBE opcode.
9518 ** comments in VDBE programs that show key decision points in the code
9522 SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe*, const char*, ...);
9524 SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe*, const char*, ...);
9539 ** for VDBE branch instructions. The coverage testing points are line
9540 ** numbers in the sqlite3.c source file. VDBE branch coverage testing
9541 ** only works with an amalagmation build. That's ok since a VDBE branch
9543 ** should ever ship with VDBE branch coverage measuring turned on.
9554 ** Every VDBE branch operation must be tagged with one of the macros above.
9557 ** routine in vdbe.c, alerting the developer to the missed tag.
9560 SQLITE_PRIVATE void sqlite3VdbeSetLineNumber(Vdbe*,int);
9576 /************** End of vdbe.h ************************************************/
10436 struct Vdbe *pVdbe; /* List of active virtual machines */
10552 #define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */
10565 #define SQLITE_VdbeListing 0x00000400 /* Debug listings of VDBE programs */
10680 #define SQLITE_FUNC_EPHEM 0x010 /* Ephemeral. Delete with VDBE */
10739 ** opened savepoint. Savepoints are added to the list by the vdbe
10932 ** when the VDBE cursor to the table is closed. In this case Table.tnum
10933 ** refers VDBE cursor number that holds the table open, not to the root
11111 ** the OP_MakeRecord opcode of the VDBE and is disassembled by the
11314 ** the integer cursor number of a VDBE cursor pointing to that table and
11581 int iCursor; /* The VDBE cursor number used to access this table */
11677 ** in the VDBE that record the limit and offset counters.
11853 ** A Vdbe sub-program that implements the body and WHEN clause of trigger
11910 Vdbe *pVdbe; /* An engine for executing database bytecode */
11924 int nTab; /* Number of previously allocated VDBE cursors */
11928 int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
11993 Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
12222 /* The following callback (if not NULL) is invoked on every VDBE branch
12464 SQLITE_PRIVATE void sqlite3ExplainBegin(Vdbe*);
12465 SQLITE_PRIVATE void sqlite3ExplainPrintf(Vdbe*, const char*, ...);
12466 SQLITE_PRIVATE void sqlite3ExplainNL(Vdbe*);
12467 SQLITE_PRIVATE void sqlite3ExplainPush(Vdbe*);
12468 SQLITE_PRIVATE void sqlite3ExplainPop(Vdbe*);
12469 SQLITE_PRIVATE void sqlite3ExplainFinish(Vdbe*);
12470 SQLITE_PRIVATE void sqlite3ExplainSelect(Vdbe*, Select*);
12471 SQLITE_PRIVATE void sqlite3ExplainExpr(Vdbe*, Expr*);
12472 SQLITE_PRIVATE void sqlite3ExplainExprList(Vdbe*, ExprList*);
12473 SQLITE_PRIVATE const char *sqlite3VdbeExplanation(Vdbe*);
12614 SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(Vdbe*, Table*, int, int, int);
12648 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
12808 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *, Index *);
12809 SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe*, Table*, int);
12881 SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
12975 SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, Vdbe*);
12982 SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe*, sqlite3_vtab*);
12998 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
13001 SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
13132 SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe*);
13420 ** the vdbe.c file.
13871 ** VDBE. This information used to all be at the top of the single
13872 ** source code file "vdbe.c". When that file became too big (over
13905 /* Elements of the linked list at Vdbe.pAuxData */
13949 ** Vdbe.cacheCtr. Vdbe.cacheCtr will never take on the value of
13956 u32 cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */
13972 ** values stored in the Vdbe struct. When the sub-program is finished,
13973 ** these values are copied back to the Vdbe from the VdbeFrame structure,
13980 ** is linked into the Vdbe.pDelFrame list. The contents of the Vdbe.pDelFrame
13986 ** The currently executing frame is stored in Vdbe.pFrame. Vdbe.pFrame is
13991 Vdbe *v; /* VM this frame belongs to */
13996 VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */
14006 int nChange; /* Statement changes (Vdbe.nChanges) */
14017 ** Internally, the vdbe manipulates nearly all SQL values as Mem
14102 ** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed
14131 Vdbe *pVdbe; /* The VM that owns this context */
14143 Vdbe *pVdbe; /* Attach the explanation to this Vdbe */
14162 ** The Vdbe.inVtabMethod variable is set to non-zero for the duration of
14163 ** any virtual table method invocations made by the vdbe program. It is
14170 struct Vdbe {
14177 Parse *pParse; /* Parsing context used to create this Vdbe */
14183 Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
14218 void *pFree; /* Free this when deleting the vdbe */
14234 ** The following are allowed values for Vdbe.magic
14236 #define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */
14237 #define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */
14238 #define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */
14239 #define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
14244 SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*);
14245 void sqliteVdbePopStack(Vdbe*,int);
14254 SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe*, int, int);
14259 SQLITE_PRIVATE int sqlite3VdbeExec(Vdbe*);
14260 SQLITE_PRIVATE int sqlite3VdbeList(Vdbe*);
14261 SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe*);
14296 SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *, int);
14299 SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p);
14311 SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe*);
14312 SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe*);
14319 SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe*,Mem*);
14324 SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *, int);
14331 SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe*);
14536 struct Vdbe *pVdbe; /* Used to iterate through VMs */
58554 ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the
60855 ** stores a single value in the VDBE. Mem is an opaque structure visible
60856 ** only within the VDBE. Interface routines refer to a Mem using the
61453 SQLITE_PRIVATE void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
62034 Vdbe *v;
62249 ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior
62250 ** to version 2.8.7, all this code was combined into the vdbe.c source file.
62257 SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
62259 Vdbe *p;
62260 p = sqlite3DbMallocZero(db, sizeof(Vdbe) );
62280 SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
62295 Vdbe *p = (Vdbe *)pStmt;
62300 ** Swap all content between two VDBE structures.
62302 SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
62303 Vdbe tmp, *pTmp;
62321 ** Resize the Vdbe.aOp array so that it is at least nOp elements larger
62326 ** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
62328 ** correctly deallocated along with the rest of the Vdbe).
62330 static int growOpArray(Vdbe *v, int nOp){
62371 ** VDBE. Return the address of the new instruction.
62375 ** p Pointer to the VDBE
62385 SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, int p3){
62433 SQLITE_PRIVATE int sqlite3VdbeAddOp0(Vdbe *p, int op){
62436 SQLITE_PRIVATE int sqlite3VdbeAddOp1(Vdbe *p, int op, int p1){
62439 SQLITE_PRIVATE int sqlite3VdbeAddOp2(Vdbe *p, int op, int p1, int p2){
62448 Vdbe *p, /* Add the opcode to this VM */
62469 SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe *p, int iDb, char *zWhere){
62480 Vdbe *p, /* Add the opcode to this VM */
62496 ** the label is resolved to a specific address, the VDBE will scan
62500 ** The VDBE knows that a P2 value is a label because labels are
62506 SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *v){
62525 SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe *v, int x){
62537 ** Mark the VDBE as one that can only be run one time.
62539 SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe *p){
62547 ** in a Vdbe main program and each of the sub-programs (triggers) it may
62554 ** sIter.v = v; // v is of type Vdbe*
62563 Vdbe *v; /* Vdbe to iterate through the opcodes of */
62570 Vdbe *v = p->v;
62633 SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
62673 ** sqlite3VdbeMakeReady() to size the Vdbe.apArg[] array.
62677 static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
62759 SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *p){
62766 ** the Vdbe passed as the first argument. It is the callers responsibility
62772 ** the number of entries in the Vdbe.apArg[] array required to execute the
62775 SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe *p, int *pnOp, int *pnMaxArg){
62792 SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp, int iLineno){
62842 SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, u32 addr, int val){
62853 SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){
62863 SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
62874 SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u8 val){
62886 SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe *p, int addr){
62968 ** list at Vdbe.pSubProgram. This list is used to delete all sub-program
62971 SQLITE_PRIVATE void sqlite3VdbeLinkSubProgram(Vdbe *pVdbe, SubProgram *p){
62979 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
62993 SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
63015 ** the Vdbe. In these cases we can just copy the pointer.
63019 SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){
63073 Vdbe *v = pParse->pVdbe;
63087 static void vdbeVComment(Vdbe *p, const char *zFormat, va_list ap){
63096 SQLITE_PRIVATE void sqlite3VdbeComment(Vdbe *p, const char *zFormat, ...){
63104 SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){
63119 SQLITE_PRIVATE void sqlite3VdbeSetLineNumber(Vdbe *v, int iLine){
63137 SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe *p, int addr){
63167 ** Compute a string for the "comment" field of a VDBE opcode listing.
63169 ** The Synopsis: field in comments in the vdbe.c source file gets converted
63355 ** Declare to the Vdbe that the BTree object at db->aDb[i] is used.
63362 SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){
63393 SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe *p){
63414 SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){
63449 ** information from the vdbe.c source text */
63537 Vdbe *p /* The VDBE */
63577 ** to trigger subprograms. The VDBE is guaranteed to have at least 9
63584 nSub = pSub->n/sizeof(Vdbe*);
63713 ** Print the SQL that was used to generate a VDBE program.
63715 SQLITE_PRIVATE void sqlite3VdbePrintSql(Vdbe *p){
63734 SQLITE_PRIVATE void sqlite3VdbeIOTraceSql(Vdbe *p){
63801 ** Rewind the VDBE back to the beginning in preparation for
63804 SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){
63844 ** After the VDBE has be prepped, it can be executed by one or more
63851 ** the Vdbe from the Parse object that helped generate it so that the
63852 ** the Vdbe becomes an independent entity and the Parse object can be
63859 Vdbe *p, /* The VDBE */
63889 ** the vdbe program. Instead they are used to allocate space for
63898 /* Allocate space for memory registers, SQL variables, VDBE cursors and
63967 ** Close a VDBE cursor and release all the resources that cursor
63970 SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
63994 ** Copy the values stored in the VdbeFrame structure to its Vdbe. This
63999 Vdbe *v = pFrame->v;
64016 ** Also release any dynamic memory held by the VM in the Vdbe.aMem memory
64021 static void closeAllCursors(Vdbe *p){
64061 static void Cleanup(Vdbe *p){
64065 /* Execute assert() statements to ensure that the Vdbe.apCsr[] and
64066 ** Vdbe.aMem[] arrays have already been cleaned up. */
64082 ** execution of the vdbe program so that sqlite3_column_count() can
64085 SQLITE_PRIVATE void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
64111 ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
64114 Vdbe *p, /* Vdbe being configured */
64141 static int vdbeCommit(sqlite3 *db, Vdbe *p){
64380 ** matches the number of vdbe's in the list sqlite3.pVdbe that are
64389 Vdbe *p;
64411 ** If the Vdbe passed as the first argument opened a statement-transaction,
64420 SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){
64424 /* If p->iStatement is greater than zero, then this Vdbe opened a
64486 SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *p, int deferred){
64501 ** This routine is called the when a VDBE tries to halt. If the VDBE
64513 SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
64608 /* The auto-commit flag is true, the vdbe program was successful
64707 ** Each VDBE holds the result of the most recent sqlite3_step() call
64710 SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe *p){
64715 ** Copy the error code and error message belonging to the VDBE passed
64719 ** This function does not clear the VDBE error code or message, just
64722 SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p){
64744 static void vdbeInvokeSqllog(Vdbe *v){
64761 ** Clean up a VDBE after execution but do not delete the VDBE just yet.
64764 ** After this routine is run, the VDBE should be ready to be executed
64771 SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
64781 /* If the VDBE has be run even partially, then transfer the error code
64782 ** and error message from the VDBE into the main database structure. But
64783 ** if the VDBE has just been set to run but has not actually executed any
64793 /* The expired flag was set on the VDBE before the first call
64802 /* Reclaim all memory used by the VDBE
64806 /* Save profiling information from this VDBE run.
64848 ** Clean up and delete a VDBE after execution. Return an integer which is
64851 SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){
64877 SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe *pVdbe, int iOp, int mask){
64897 ** Free all memory associated with the Vdbe passed as the second argument,
64901 ** VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
64904 SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
64927 ** Delete an entire VDBE.
64929 SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){
65579 ** the user deletes the collation sequence after the vdbe program is
65646 ** created by th OP_MakeRecord opcode of the VDBE. The pPKey2
66182 ** Set a flag in the vdbe to update the change counter when it is finalised
66185 SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe *v){
66200 Vdbe *p;
66207 ** Return the database associated with the Vdbe.
66209 SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){
66221 SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe *v, int iVar, u8 aff){
66242 SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
66254 ** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
66257 SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){
66281 ** VDBE.
66294 Vdbe *p = (Vdbe*)pStmt;
66300 ** Check on a Vdbe to make sure it has not been finalized. Log
66304 static int vdbeSafety(Vdbe *p){
66312 static int vdbeSafetyNotNull(Vdbe *p){
66337 Vdbe *v = (Vdbe*)pStmt;
66361 Vdbe *v = (Vdbe*)pStmt;
66378 Vdbe *p = (Vdbe*)pStmt;
66380 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
66638 static int sqlite3Step(Vdbe *p){
66770 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
66841 Vdbe *v = p->pVdbe;
66927 Vdbe *pVdbe = pCtx->pVdbe;
66980 Vdbe *pVm = (Vdbe *)pStmt;
66989 Vdbe *pVm = (Vdbe *)pStmt;
67026 Vdbe *pVm;
67029 pVm = (Vdbe *)pStmt;
67068 Vdbe *p = (Vdbe *)pStmt;
67164 Vdbe *p = (Vdbe *)pStmt;
67294 static int vdbeUnbind(Vdbe *p, int i){
67318 /* If the bit corresponding to this variable in Vdbe.expmask is set, then
67346 Vdbe *p = (Vdbe *)pStmt;
67383 Vdbe *p = (Vdbe *)pStmt;
67396 Vdbe *p = (Vdbe *)pStmt;
67406 Vdbe *p = (Vdbe*)pStmt;
67466 Vdbe *p = (Vdbe *)pStmt;
67480 Vdbe *p = (Vdbe*)pStmt;
67491 Vdbe *p = (Vdbe*)pStmt;
67503 SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
67519 return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName));
67526 Vdbe *pFrom = (Vdbe*)pFromStmt;
67527 Vdbe *pTo = (Vdbe*)pToStmt;
67553 Vdbe *pFrom = (Vdbe*)pFromStmt;
67554 Vdbe *pTo = (Vdbe*)pToStmt;
67575 return pStmt ? ((Vdbe*)pStmt)->db : 0;
67583 return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
67590 Vdbe *v = (Vdbe*)pStmt;
67606 pNext = (sqlite3_stmt*)((Vdbe*)pStmt)->pNext;
67616 Vdbe *pVdbe = (Vdbe*)pStmt;
67639 ** The Vdbe parse-tree explainer is also found here.
67694 Vdbe *p, /* The prepared statement being evaluated */
67810 ** for the Vdbe.
67818 SQLITE_PRIVATE void sqlite3ExplainBegin(Vdbe *pVdbe){
67847 SQLITE_PRIVATE void sqlite3ExplainPrintf(Vdbe *pVdbe, const char *zFormat, ...){
67865 SQLITE_PRIVATE void sqlite3ExplainNL(Vdbe *pVdbe){
67876 SQLITE_PRIVATE void sqlite3ExplainPush(Vdbe *pVdbe){
67897 SQLITE_PRIVATE void sqlite3ExplainPop(Vdbe *p){
67904 SQLITE_PRIVATE void sqlite3ExplainFinish(Vdbe *pVdbe){
67918 SQLITE_PRIVATE const char *sqlite3VdbeExplanation(Vdbe *pVdbe){
67924 /************** Begin file vdbe.c ********************************************/
67974 ** each instruction in the VDBE. When it reaches zero, the u1.isInterrupted
67997 ** or MEM_Str that has been used by a VDBE opcode. The test procedures
68033 ** Invoke the VDBE coverage callback, if that callback is defined. This
68043 ** generated the VDBE instruction. This instrumentation assumes that all
68097 Vdbe *p, /* The virtual machine */
68105 ** vdbe memory cell to manage the memory allocation required for a
68109 ** purposes in a vdbe program. The different uses might require
68392 /************** Include hwtime.h in the middle of vdbe.c *********************/
68481 /************** Continuing where we left off in vdbe.c ***********************/
68507 ** Execute as much of a VDBE program as we can.
68511 Vdbe *p /* The VDBE */
68573 printf("VDBE Program Listing:\n");
68581 if( once ) printf("VDBE Query Plan:\n");
68587 if( p->db->flags & SQLITE_VdbeTrace ) printf("VDBE Trace:\n");
68696 ** Documentation about VDBE opcodes is generated by scanning this file
68737 ** of VDBE ops have been executed (either since this invocation of
68879 ** VDBE, but do not rollback the transaction.
70334 VdbeCursor *pC; /* The VDBE cursor */
71038 ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is
71039 ** true (this flag is set if the Vdbe may modify more than one row and may
71044 ** VDBE to be rolled back after an error without having to roll back the
71046 ** will automatically commit when the VDBE halts.
71974 ** If P3>0 then P3 is a register in the root frame of this VDBE that holds
71987 VdbeFrame *pFrame; /* Root frame of VDBE */
72957 Vdbe *pVdbe;
73392 ** memory required by the sub-vdbe at runtime.
73404 VdbeFrame *pFrame; /* New vdbe frame to execute in */
74049 /* Initialize vdbe cursor object */
74553 /************** End of vdbe.c ************************************************/
74608 Vdbe *v = (Vdbe *)p->pStmt;
74671 /* This VDBE program seeks a btree cursor to the identified
74672 ** db/table/row entry. The reason for using a vdbe program instead
74674 ** vdbe program will take advantage of the various transaction,
74675 ** locking and error handling infrastructure built into the vdbe.
74677 ** After seeking the cursor, the vdbe executes an OP_ResultRow.
74678 ** Code external to the Vdbe then "borrows" the b-tree cursor and
74682 ** The sqlite3_blob_close() function finalizes the vdbe program,
74809 Vdbe *v = (Vdbe *)pBlob->pStmt;
74842 ** we can invoke OP_Column to fill in the vdbe cursors type
74870 if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt);
74915 Vdbe *v;
74921 v = (Vdbe*)p->pStmt;
75890 ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly
75928 ** These iterators will be incrementally merged as the VDBE layer calls
78110 ** Expr.iTable The VDBE cursor number for X.Y
78260 ** for generating VDBE code that evaluates expressions in SQLite.
79723 Vdbe *v = sqlite3GetVdbe(pParse); /* Virtual machine being coded */
79733 static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){
79837 Vdbe *v = sqlite3GetVdbe(pParse); /* Virtual machine being coded */
79867 /* This function is only called from two places. In both cases the vdbe
79992 Vdbe *v = sqlite3GetVdbe(pParse);
80222 Vdbe *v; /* Statement under construction */
80365 static char *dup8bytes(Vdbe *v, const char *in){
80382 static void codeReal(Vdbe *v, const char *z, int negateFlag, int iMem){
80403 Vdbe *v = pParse->pVdbe;
80588 Vdbe *v, /* The VDBE under construction */
80626 Vdbe *v = pParse->pVdbe;
80722 ** Generate code into the current Vdbe to evaluate the given
80733 Vdbe *v = pParse->pVdbe; /* The VM under construction */
81360 Expr *pExpr, /* The expression to code when the VDBE initializes */
81388 ** VDBE program, in order to factor it out of the evaluation loop.
81470 Vdbe *v = pParse->pVdbe;
81485 SQLITE_PRIVATE void sqlite3ExplainExpr(Vdbe *pOut, Expr *pExpr){
81724 SQLITE_PRIVATE void sqlite3ExplainExprList(Vdbe *pOut, ExprList *pList){
81787 Vdbe *v = pParse->pVdbe;
81868 ** operation. Special comments in vdbe.c and the mkopcodeh.awk script in
81873 Vdbe *v = pParse->pVdbe;
81880 if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
81998 Vdbe *v = pParse->pVdbe;
82005 if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
82613 ** This file contains C code routines that used to generate VDBE code
82934 Vdbe *v;
83006 Vdbe *v;
83196 Vdbe *v;
83198 /* The VDBE
83352 Vdbe *v;
83628 Vdbe *v = sqlite3GetVdbe(pParse);
84363 static void callStatGet(Vdbe *v, int regStat4, int iParam, int regOut){
84393 Vdbe *v; /* The virtual machine being built up */
84707 Vdbe *v = sqlite3GetVdbe(pParse);
84782 Vdbe *v;
85582 ** This procedure generates VDBE code for a single invocation of either the
85596 Vdbe *v;
86211 Vdbe *pVdbe;
86214 assert( pVdbe!=0 ); /* sqlite3GetVdbe cannot fail: VDBE already allocated */
86242 ** parsed and a VDBE program to execute that statement has been
86244 ** VDBE program and resets the pParse structure for the next
86248 ** no VDBE code was generated.
86252 Vdbe *v;
86261 ** vdbe program
86327 /* Get the VDBE program ready for execution
86773 Vdbe *v = sqlite3GetVdbe(p);
86929 Vdbe *v;
87408 Vdbe *v = pParse->pVdbe;
87539 Vdbe *v = pParse->pVdbe;
87731 ** internal schema data structures and the generated VDBE code so that they
87757 Vdbe *v = pParse->pVdbe;
87941 Vdbe *v;
88281 ** This function is called by the VDBE to adjust the internal schema
88329 Vdbe *v = sqlite3GetVdbe(pParse);
88351 ** Write VDBE code to erase table pTab and all associated indices on disk.
88438 Vdbe *v;
88510 Vdbe *v;
88773 Vdbe *v; /* Generate code into this virtual machine */
89287 Vdbe *v;
89420 Vdbe *v;
89854 Vdbe *v;
89879 Vdbe *v;
89896 Vdbe *v;
89916 Vdbe *v = sqlite3GetVdbe(pParse);
89965 ** will occur at the end of the top-level VDBE and will be generated
90001 ** Generate VDBE code that prepares for doing an operation that
90054 ** Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
90066 Vdbe *v = sqlite3GetVdbe(pParse);
91074 Vdbe *v; /* The virtual database engine */
91081 int iDataCur; /* VDBE cursor for the canonical data source */
91420 ** This routine generates VDBE code that causes a single row of a
91451 Vdbe *v = pParse->pVdbe; /* Vdbe */
91456 /* Vdbe is guaranteed to have been allocated by this stage. */
91551 ** This routine generates VDBE code that causes the deletion of all
91580 Vdbe *v; /* The prepared statement under construction */
91640 Vdbe *v = pParse->pVdbe;
92135 ** as VDBE code so that unused argument values do not have to be computed.
93529 ** object (struct Vdbe). If, after the statement has run, its immediate
93548 ** row are required by the FK processing VDBE code (i.e. if FKs were
93567 ** VDBE Calling Convention
93739 ** Each time it is called, this function generates VDBE code to locate the
93770 Vdbe *v = sqlite3GetVdbe(pParse); /* Vdbe to add code to */
93989 Vdbe *v = sqlite3GetVdbe(pParse);
94067 /* Create VDBE to loop through the entries in pSrc that match the WHERE
94146 Vdbe *v = sqlite3GetVdbe(pParse);
94148 assert( v ); /* VDBE has already been allocated */
94152 ** generating any VDBE code. If one can be found, then jump over
94169 ** violations, halt the VDBE and return an error at this point, before
94256 ** table pTab to generate VDBE code to perform foreign key constraint
94335 Vdbe *v = sqlite3GetVdbe(pParse);
94832 Parse *pParse, /* Generate code into this VDBE */
94838 Vdbe *v;
94877 SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){
94925 SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe *v, Table *pTab, int iReg){
94956 ** have been opened at any point in the VDBE program. This is used to see if
94961 Vdbe *v = sqlite3GetVdbe(p);
95052 int addr; /* A VDBE address */
95053 Vdbe *v = pParse->pVdbe; /* VDBE under construction */
95105 Vdbe *v = pParse->pVdbe;
95253 Vdbe *v; /* Generate code into this virtual machine */
95257 int iDataCur = 0; /* VDBE cursor that is the main data repository */
95353 /* Allocate a VDBE
95943 Vdbe *v; /* VDBE under constrution */
96122 ** also invoke MultiWrite() to indicate that this VDBE may require
96351 Vdbe *v; /* Prepared statements under construction */
96434 Vdbe *v;
96580 Vdbe *v; /* The VDBE we are building */
96928 sqlite3VdbeFinalize((Vdbe *)pStmt);
96936 rc = sqlite3VdbeFinalize((Vdbe *)pStmt);
96949 if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
98826 Vdbe *v = sqlite3GetVdbe(pParse);
98943 Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */
100028 ** the VDBE created below.
100032 ** to -1 here, to indicate that the VDBE should verify the integrity
100038 /* Initialize the VDBE program */
100625 ** This routine is also called from the OP_ParseSchema opcode of the VDBE.
100654 ** But because db->init.busy is set to 1, no VDBE code is generated
101128 Vdbe *pReprepare, /* VM being reprepared */
101251 Vdbe *pVdbe = pParse->pVdbe;
101288 Vdbe *pOld, /* VM being reprepared */
101319 SQLITE_PRIVATE int sqlite3Reprepare(Vdbe *p){
101340 sqlite3VdbeSwap((Vdbe*)pNew, p);
101342 sqlite3VdbeResetStepResult((Vdbe*)pNew);
101343 sqlite3VdbeFinalize((Vdbe*)pNew);
101936 Vdbe *v = pParse->pVdbe;
102007 Vdbe *v, /* Generate code into this VM */
102036 Vdbe *v;
102091 Vdbe *v = pParse->pVdbe;
102519 Vdbe *v = pParse->pVdbe;
102564 Vdbe *v = pParse->pVdbe;
102590 Vdbe *v = pParse->pVdbe; /* The prepared statement */
102873 ** Generate code that will tell the VDBE the declaration types of columns
102882 Vdbe *v = pParse->pVdbe;
102896 /* The vdbe must make its own copy of the column-type and other
102912 ** Generate code that will tell the VDBE the names of columns
102921 Vdbe *v = pParse->pVdbe;
103168 ** Get a VDBE for the given parser context. Create a new one if necessary.
103171 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse *pParse){
103172 Vdbe *v = pParse->pVdbe;
103211 Vdbe *v = 0;
103324 ** This routine generates VDBE code to compute the content of a WITH RECURSIVE
103366 Vdbe *v = pParse->pVdbe; /* The prepared statement under construction */
103532 Vdbe *v; /* Generate code to this VDBE */
103563 assert( v!=0 ); /* The VDBE already created by calling function */
103909 Vdbe *v = pParse->pVdbe;
104128 Vdbe *v; /* Generate code to this VDBE */
104169 assert( v!=0 ); /* Already thrown the error if VDBE alloc failed */
104444 ** FROM clause of a SELECT such that the VDBE cursor assigned to that
104660 int iParent; /* VDBE cursor number of the pSub result set temp table */
105390 ** (1) Make sure VDBE cursor numbers have been assigned to every
105788 ** * VDBE Cursor numbers are assigned to all FROM-clause terms.
105822 Vdbe *v = pParse->pVdbe;
105863 Vdbe *v = pParse->pVdbe;
105879 Vdbe *v = pParse->pVdbe;
105956 ** Add a single OP_Explain instruction to the VDBE to explain a simple
106001 Vdbe *v; /* The virtual machine under construction */
106679 ** add vdbe code to break out of the processing loop after the
106788 static void explainOneSelect(Vdbe *pVdbe, Select *p){
106858 SQLITE_PRIVATE void sqlite3ExplainSelect(Vdbe *pVdbe, Select *p){
107383 Vdbe *v;
107620 Vdbe *v;
107778 ** Generate VDBE code for the statements inside the body of a single
107787 Vdbe *v = pParse->pVdbe;
107855 ** This function is used to add VdbeComment() annotations to a VDBE
107872 ** Parse context structure pFrom has just been used to create a sub-vdbe
107901 Vdbe *v; /* Temporary VM */
107902 NameContext sNC; /* Name context for sub-vdbe */
107903 SubProgram *pProgram = 0; /* Sub-vdbe for trigger program */
107904 Parse *pSubParse; /* Parse context for sub-vdbe */
107955 ** (or NULL) the sub-vdbe is immediately halted by jumping to the
107968 /* Code the trigger program into the sub-vdbe. */
108047 Vdbe *v = sqlite3GetVdbe(pParse); /* Main VM */
108052 /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program
108053 ** is a pointer to the sub-vdbe containing the trigger program. */
108265 SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){
108302 int addrTop = 0; /* VDBE instruction address of the start of the loop */
108304 Vdbe *v; /* The virtual database engine */
108914 Vdbe *v = pParse->pVdbe; /* Virtual machine under construction */
109006 rc = sqlite3VdbeFinalize((Vdbe*)pStmt);
109084 Vdbe *v = sqlite3GetVdbe(pParse);
109093 ** This routine implements the OP_Vacuum opcode of the VDBE.
109731 Vdbe *v;
109996 ** This function is invoked by the vdbe to call the xCreate method
110102 ** This function is invoked by the vdbe to call the xDestroy method
110166 SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, Vdbe *p){
110462 ** This module contains C code that generates VDBE code used to process
110534 int iTabCur; /* The VDBE cursor used to access the table */
110535 int iIdxCur; /* The VDBE cursor used to access pIdx */
110549 int iCur; /* The VDBE cursor used by this IN operator */
110700 ** bits that will fit in a Bitmask. The VDBE cursor numbers might be
110807 ** between VDBE cursor numbers and bits of the bitmasks in WhereTerm.
110809 ** The VDBE cursor numbers are small integers contained in
110818 ** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<<A.
110820 ** For example, if the WHERE clause expression used these VDBE
110960 ** Return the VDBE address or label to jump to in order to continue
110969 ** Return the VDBE address or label to jump to in order to break
111588 Vdbe *pReprepare = pParse->pReprepare;
111611 Vdbe *v = pParse->pVdbe;
112499 Vdbe *v; /* Prepared statement under construction */
113365 Vdbe *v = pParse->pVdbe;
113413 Vdbe *v = pParse->pVdbe;
113531 Vdbe *v = pParse->pVdbe; /* The vm under construction */
113719 Vdbe *v = pParse->pVdbe; /* VM being constructed */
113801 int iCur; /* The VDBE cursor for the table */
113811 Vdbe *v; /* The prepared stmt under constructions */
114080 int iIdxCur; /* The VDBE cursor for the index */
114672 static void whereExplainTerm(Vdbe *v, WhereTerm *pTerm){
114728 Vdbe *v = pWInfo->pParse->pVdbe;
116818 ** And so forth. This routine generates code to open those VDBE cursors
116884 Vdbe *v = pParse->pVdbe; /* The virtual database engine */
117043 Vdbe *v = pParse->pVdbe;
117292 Vdbe *v = pParse->pVdbe;
117418 /* If this scan uses an index, make VDBE code substitutions to read data
125514 *pzRet = sqlite3VdbeExplanation((Vdbe*)pStmt);
125535 ** Set the VDBE coverage callback function to xCallback with context
133101 ** be tested by the VDBE layer. The test will always be false (since