Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
vdbeInt.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Cursor
struct  Sorter
struct  Mem
struct  sqlite_func
struct  Agg
struct  AggElem
struct  Set
struct  Keylist
struct  Context
struct  Vdbe

Defines

#define keyToInt(X)   (sqliteVdbeByteSwap(X) ^ 0x80000000)
#define intToKey(X)   (sqliteVdbeByteSwap((X) ^ 0x80000000))
#define NSORT   30
#define NBFS   32
#define MEM_Null   0x0001 /* Value is NULL */
#define MEM_Str   0x0002 /* Value is a string */
#define MEM_Int   0x0004 /* Value is an integer */
#define MEM_Real   0x0008 /* Value is a real number */
#define MEM_Dyn   0x0010 /* Need to call sqliteFree() on Mem.z */
#define MEM_Static   0x0020 /* Mem.z points to a static string */
#define MEM_Ephem   0x0040 /* Mem.z points to an ephemeral string */
#define MEM_Short   0x0080 /* Mem.z points to Mem.zShort */
#define MEM_AggCtx   0x0100 /* Mem.z points to an agg function context */
#define VDBE_MAGIC_INIT   0x26bceaa5 /* Building a VDBE program */
#define VDBE_MAGIC_RUN   0xbdf20da3 /* VDBE is ready to execute */
#define VDBE_MAGIC_HALT   0x519c2973 /* VDBE has completed execution */
#define VDBE_MAGIC_DEAD   0xb606c3c8 /* The VDBE has been deallocated */

Typedefs

typedef struct VdbeOp
typedef unsigned char Bool
typedef struct Cursor
typedef struct Sorter
typedef struct Mem
typedef struct Agg
typedef struct AggElem
typedef struct Set
typedef struct Keylist
typedef struct Context

Functions

void sqliteVdbeCleanupCursor (Cursor *)
void sqliteVdbeSorterReset (Vdbe *)
void sqliteVdbeAggReset (Agg *)
void sqliteVdbeKeylistFree (Keylist *)
void sqliteVdbePopStack (Vdbe *, int)
int sqliteVdbeCursorMoveto (Cursor *)
int sqliteVdbeByteSwap (int)
void sqliteVdbePrintOp (FILE *, int, Op *)

Variables

char * sqliteOpcodeNames []

Class Documentation

struct Cursor

Definition at line 63 of file vdbeInt.h.

Collaboration diagram for Cursor:
Class Members
Bool atFirst
Bool deferredMoveto
int iKey
Bool keyAsData
int lastRecno
int movetoTarget
int nData
int nextRowid
Bool nextRowidValid
Bool nullRow
Btree * pBt
BtCursor * pCursor
char * pData
Bool pseudoTable
Bool recnoIsValid
Bool useRandomRowid
struct Sorter

Definition at line 88 of file vdbeInt.h.

Collaboration diagram for Sorter:
Class Members
int nData
int nKey
char * pData
Sorter * pNext
char * zKey
struct sqlite_func

Definition at line 153 of file vdbeInt.h.

Collaboration diagram for sqlite_func:
Class Members
int cnt
u8 isError
u8 isStep
void * pAgg
FuncDef * pFunc
Mem s
struct Agg

Definition at line 171 of file vdbeInt.h.

Collaboration diagram for Agg:
Class Members
FuncDef ** apFunc
Hash hash
int nMem
AggElem * pCurrent
HashElem * pSearch
struct AggElem

Definition at line 178 of file vdbeInt.h.

Class Members
Mem aMem
int nKey
char * zKey
struct Set

Definition at line 191 of file vdbeInt.h.

Collaboration diagram for Set:
Class Members
Hash hash
HashElem * prev
struct Keylist

Definition at line 202 of file vdbeInt.h.

Collaboration diagram for Keylist:
Class Members
int aKey
int nKey
int nRead
int nUsed
Keylist * pNext
struct Context

Definition at line 217 of file vdbeInt.h.

Class Members
int csChange
int lastRowid
int lsChange
struct Vdbe

Definition at line 230 of file vdbeInt.h.

Collaboration diagram for Vdbe:
Class Members
u8 * abVar
Mem * aColName
int aCounter
Cursor * aCsr
Agg agg
int * aLabel
Mem * aMem
int * anVar
Op * aOp
Mem ** apArg
VdbeCursor ** apCsr
Set * aSet
Mem * aStack
Mem * aVar
char ** azColName
char ** azField
char ** azResColumn
char ** azVar
yDbMask btreeMask
u32 cacheCtr
u8 changeCntOn
Context * contextStack
int contextStackDepth
sqlite * db
sqlite3 * db
int errorAction
u8 errorAction
u8 expired
u8 explain
u32 expmask
int inTempTrans
u8 inVtabMethod
u8 isPrepareV2
int iStatement
Keylist ** keylistStack
int keylistStackDepth
yDbMask lockMask
int magic
u32 magic
u8 minWriteFileFormat
int nCallback
int nChange
int nCursor
u16 nCursor
int nField
i64 nFkConstraint
int nFrame
int nLabel
int nLabelAlloc
int nLineAlloc
int nMem
int nOp
int nOpAlloc
int nResColumn
u16 nResColumn
int nSet
i64 nStmtDefCons
int nVar
ynVar nVar
ynVar nzVar
int pc
VdbeFrame * pDelFrame
FILE * pFile
VdbeFrame * pFrame
void * pFree
Keylist * pList
Vdbe * pNext
int popStack
Vdbe * pPrev
SubProgram * pProgram
Mem * pResultSet
Sorter * pSort
Mem * pTos
int rc
u8 readOnly
int returnDepth
int returnStack
u8 runOnlyOnce
i64 startTime
FILE * trace
int undoTransOnError
unsigned uniqueCnt
u8 usesStmtJournal
char ** zArgv
char * zErrMsg
char * zLine
char * zSql

Define Documentation

#define intToKey (   X)    (sqliteVdbeByteSwap((X) ^ 0x80000000))

Definition at line 26 of file vdbeInt.h.

#define keyToInt (   X)    (sqliteVdbeByteSwap(X) ^ 0x80000000)

Definition at line 25 of file vdbeInt.h.

#define MEM_AggCtx   0x0100 /* Mem.z points to an agg function context */

Definition at line 138 of file vdbeInt.h.

#define MEM_Dyn   0x0010 /* Need to call sqliteFree() on Mem.z */

Definition at line 129 of file vdbeInt.h.

#define MEM_Ephem   0x0040 /* Mem.z points to an ephemeral string */

Definition at line 131 of file vdbeInt.h.

#define MEM_Int   0x0004 /* Value is an integer */

Definition at line 127 of file vdbeInt.h.

#define MEM_Null   0x0001 /* Value is NULL */

Definition at line 125 of file vdbeInt.h.

#define MEM_Real   0x0008 /* Value is a real number */

Definition at line 128 of file vdbeInt.h.

#define MEM_Short   0x0080 /* Mem.z points to Mem.zShort */

Definition at line 132 of file vdbeInt.h.

#define MEM_Static   0x0020 /* Mem.z points to a static string */

Definition at line 130 of file vdbeInt.h.

#define MEM_Str   0x0002 /* Value is a string */

Definition at line 126 of file vdbeInt.h.

#define NBFS   32

Definition at line 106 of file vdbeInt.h.

#define NSORT   30

Definition at line 99 of file vdbeInt.h.

#define VDBE_MAGIC_DEAD   0xb606c3c8 /* The VDBE has been deallocated */

Definition at line 289 of file vdbeInt.h.

#define VDBE_MAGIC_HALT   0x519c2973 /* VDBE has completed execution */

Definition at line 288 of file vdbeInt.h.

#define VDBE_MAGIC_INIT   0x26bceaa5 /* Building a VDBE program */

Definition at line 286 of file vdbeInt.h.

#define VDBE_MAGIC_RUN   0xbdf20da3 /* VDBE is ready to execute */

Definition at line 287 of file vdbeInt.h.


Typedef Documentation

typedef struct Agg

Definition at line 169 of file vdbeInt.h.

typedef struct AggElem

Definition at line 170 of file vdbeInt.h.

typedef unsigned char Bool

Definition at line 46 of file vdbeInt.h.

typedef struct Context

Definition at line 216 of file vdbeInt.h.

typedef struct Cursor

Definition at line 81 of file vdbeInt.h.

typedef struct Keylist

Definition at line 201 of file vdbeInt.h.

typedef struct Mem

Definition at line 120 of file vdbeInt.h.

typedef struct Set

Definition at line 190 of file vdbeInt.h.

typedef struct Sorter

Definition at line 87 of file vdbeInt.h.

typedef struct VdbeOp

Definition at line 41 of file vdbeInt.h.


Function Documentation

void sqliteVdbeAggReset ( Agg )

Definition at line 678 of file vdbeaux.c.

                                  {
  int i;
  HashElem *p;
  for(p = sqliteHashFirst(&pAgg->hash); p; p = sqliteHashNext(p)){
    AggElem *pElem = sqliteHashData(p);
    assert( pAgg->apFunc!=0 );
    for(i=0; i<pAgg->nMem; i++){
      Mem *pMem = &pElem->aMem[i];
      if( pAgg->apFunc[i] && (pMem->flags & MEM_AggCtx)!=0 ){
        sqlite_func ctx;
        ctx.pFunc = pAgg->apFunc[i];
        ctx.s.flags = MEM_Null;
        ctx.pAgg = pMem->z;
        ctx.cnt = pMem->i;
        ctx.isStep = 0;
        ctx.isError = 0;
        (*pAgg->apFunc[i]->xFinalize)(&ctx);
        if( pMem->z!=0 && pMem->z!=pMem->zShort ){
          sqliteFree(pMem->z);
        }
        if( ctx.s.flags & MEM_Dyn ){
          sqliteFree(ctx.s.z);
        }
      }else if( pMem->flags & MEM_Dyn ){
        sqliteFree(pMem->z);
      }
    }
    sqliteFree(pElem);
  }
  sqliteHashClear(&pAgg->hash);
  sqliteFree(pAgg->apFunc);
  pAgg->apFunc = 0;
  pAgg->pCurrent = 0;
  pAgg->pSearch = 0;
  pAgg->nMem = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1030 of file vdbeaux.c.

                             {
  union {
     char zBuf[sizeof(int)];
     int i;
  } ux;
  ux.zBuf[3] = x&0xff;
  ux.zBuf[2] = (x>>8)&0xff;
  ux.zBuf[1] = (x>>16)&0xff;
  ux.zBuf[0] = (x>>24)&0xff;
  return ux.i;
}

Definition at line 730 of file vdbeaux.c.

                                         {
  if( pCx->pCursor ){
    sqliteBtreeCloseCursor(pCx->pCursor);
  }
  if( pCx->pBt ){
    sqliteBtreeClose(pCx->pBt);
  }
  sqliteFree(pCx->pData);
  memset(pCx, 0, sizeof(Cursor));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1047 of file vdbeaux.c.

                                     {
  if( p->deferredMoveto ){
    int res;
    extern int sqlite_search_count;
    sqliteBtreeMoveto(p->pCursor, (char*)&p->movetoTarget, sizeof(int), &res);
    p->lastRecno = keyToInt(p->movetoTarget);
    p->recnoIsValid = res==0;
    if( res<0 ){
      sqliteBtreeNext(p->pCursor, &res);
    }
    sqlite_search_count++;
    p->deferredMoveto = 0;
  }
  return SQLITE_OK;
}

Here is the caller graph for this function:

Definition at line 718 of file vdbeaux.c.

                                      {
  while( p ){
    Keylist *pNext = p->pNext;
    sqliteFree(p);
    p = pNext;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqliteVdbePopStack ( Vdbe ,
int   
)
void sqliteVdbePrintOp ( FILE *  ,
int  ,
Op *   
)

Definition at line 510 of file vdbeaux.c.

                                                   {
  char *zP3;
  char zPtr[40];
  if( pOp->p3type==P3_POINTER ){
    sprintf(zPtr, "ptr(%#lx)", (long)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);
}

Here is the caller graph for this function:

Definition at line 659 of file vdbeaux.c.

                                   {
  while( p->pSort ){
    Sorter *pSorter = p->pSort;
    p->pSort = pSorter->pNext;
    sqliteFree(pSorter->zKey);
    sqliteFree(pSorter->pData);
    sqliteFree(pSorter);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 2 of file opcodes.c.