extensions/sqlite/sqlite-source/vdbeInt.h
author Scott Ehlert <ds@alliedmods.net>
Sun Mar 30 07:00:22 2008 +0000 (2008-03-30)
changeset 1952 b7aa2b626807
permissions -rw-r--r--
Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile
ds@1952
     1
/*
ds@1952
     2
** 2003 September 6
ds@1952
     3
**
ds@1952
     4
** The author disclaims copyright to this source code.  In place of
ds@1952
     5
** a legal notice, here is a blessing:
ds@1952
     6
**
ds@1952
     7
**    May you do good and not evil.
ds@1952
     8
**    May you find forgiveness for yourself and forgive others.
ds@1952
     9
**    May you share freely, never taking more than you give.
ds@1952
    10
**
ds@1952
    11
*************************************************************************
ds@1952
    12
** This is the header file for information that is private to the
ds@1952
    13
** VDBE.  This information used to all be at the top of the single
ds@1952
    14
** source code file "vdbe.c".  When that file became too big (over
ds@1952
    15
** 6000 lines long) it was split up into several smaller files and
ds@1952
    16
** this header information was factored out.
ds@1952
    17
*/
ds@1952
    18
#ifndef _VDBEINT_H_
ds@1952
    19
#define _VDBEINT_H_
ds@1952
    20
ds@1952
    21
/*
ds@1952
    22
** intToKey() and keyToInt() used to transform the rowid.  But with
ds@1952
    23
** the latest versions of the design they are no-ops.
ds@1952
    24
*/
ds@1952
    25
#define keyToInt(X)   (X)
ds@1952
    26
#define intToKey(X)   (X)
ds@1952
    27
ds@1952
    28
ds@1952
    29
/*
ds@1952
    30
** SQL is translated into a sequence of instructions to be
ds@1952
    31
** executed by a virtual machine.  Each instruction is an instance
ds@1952
    32
** of the following structure.
ds@1952
    33
*/
ds@1952
    34
typedef struct VdbeOp Op;
ds@1952
    35
ds@1952
    36
/*
ds@1952
    37
** Boolean values
ds@1952
    38
*/
ds@1952
    39
typedef unsigned char Bool;
ds@1952
    40
ds@1952
    41
/*
ds@1952
    42
** A cursor is a pointer into a single BTree within a database file.
ds@1952
    43
** The cursor can seek to a BTree entry with a particular key, or
ds@1952
    44
** loop over all entries of the Btree.  You can also insert new BTree
ds@1952
    45
** entries or retrieve the key or data from the entry that the cursor
ds@1952
    46
** is currently pointing to.
ds@1952
    47
** 
ds@1952
    48
** Every cursor that the virtual machine has open is represented by an
ds@1952
    49
** instance of the following structure.
ds@1952
    50
**
ds@1952
    51
** If the Cursor.isTriggerRow flag is set it means that this cursor is
ds@1952
    52
** really a single row that represents the NEW or OLD pseudo-table of
ds@1952
    53
** a row trigger.  The data for the row is stored in Cursor.pData and
ds@1952
    54
** the rowid is in Cursor.iKey.
ds@1952
    55
*/
ds@1952
    56
struct Cursor {
ds@1952
    57
  BtCursor *pCursor;    /* The cursor structure of the backend */
ds@1952
    58
  int iDb;              /* Index of cursor database in db->aDb[] (or -1) */
ds@1952
    59
  i64 lastRowid;        /* Last rowid from a Next or NextIdx operation */
ds@1952
    60
  i64 nextRowid;        /* Next rowid returned by OP_NewRowid */
ds@1952
    61
  Bool zeroed;          /* True if zeroed out and ready for reuse */
ds@1952
    62
  Bool rowidIsValid;    /* True if lastRowid is valid */
ds@1952
    63
  Bool atFirst;         /* True if pointing to first entry */
ds@1952
    64
  Bool useRandomRowid;  /* Generate new record numbers semi-randomly */
ds@1952
    65
  Bool nullRow;         /* True if pointing to a row with no data */
ds@1952
    66
  Bool nextRowidValid;  /* True if the nextRowid field is valid */
ds@1952
    67
  Bool pseudoTable;     /* This is a NEW or OLD pseudo-tables of a trigger */
ds@1952
    68
  Bool deferredMoveto;  /* A call to sqlite3BtreeMoveto() is needed */
ds@1952
    69
  Bool isTable;         /* True if a table requiring integer keys */
ds@1952
    70
  Bool isIndex;         /* True if an index containing keys only - no data */
ds@1952
    71
  u8 bogusIncrKey;      /* Something for pIncrKey to point to if pKeyInfo==0 */
ds@1952
    72
  i64 movetoTarget;     /* Argument to the deferred sqlite3BtreeMoveto() */
ds@1952
    73
  Btree *pBt;           /* Separate file holding temporary table */
ds@1952
    74
  int nData;            /* Number of bytes in pData */
ds@1952
    75
  char *pData;          /* Data for a NEW or OLD pseudo-table */
ds@1952
    76
  i64 iKey;             /* Key for the NEW or OLD pseudo-table row */
ds@1952
    77
  u8 *pIncrKey;         /* Pointer to pKeyInfo->incrKey */
ds@1952
    78
  KeyInfo *pKeyInfo;    /* Info about index keys needed by index cursors */
ds@1952
    79
  int nField;           /* Number of fields in the header */
ds@1952
    80
  i64 seqCount;         /* Sequence counter */
ds@1952
    81
  sqlite3_vtab_cursor *pVtabCursor;  /* The cursor for a virtual table */
ds@1952
    82
  const sqlite3_module *pModule;     /* Module for cursor pVtabCursor */
ds@1952
    83
ds@1952
    84
  /* Cached information about the header for the data record that the
ds@1952
    85
  ** cursor is currently pointing to.  Only valid if cacheValid is true.
ds@1952
    86
  ** aRow might point to (ephemeral) data for the current row, or it might
ds@1952
    87
  ** be NULL.
ds@1952
    88
  */
ds@1952
    89
  int cacheStatus;      /* Cache is valid if this matches Vdbe.cacheCtr */
ds@1952
    90
  int payloadSize;      /* Total number of bytes in the record */
ds@1952
    91
  u32 *aType;           /* Type values for all entries in the record */
ds@1952
    92
  u32 *aOffset;         /* Cached offsets to the start of each columns data */
ds@1952
    93
  u8 *aRow;             /* Data for the current row, if all on one page */
ds@1952
    94
};
ds@1952
    95
typedef struct Cursor Cursor;
ds@1952
    96
ds@1952
    97
/*
ds@1952
    98
** Number of bytes of string storage space available to each stack
ds@1952
    99
** layer without having to malloc.  NBFS is short for Number of Bytes
ds@1952
   100
** For Strings.
ds@1952
   101
*/
ds@1952
   102
#define NBFS 32
ds@1952
   103
ds@1952
   104
/*
ds@1952
   105
** A value for Cursor.cacheValid that means the cache is always invalid.
ds@1952
   106
*/
ds@1952
   107
#define CACHE_STALE 0
ds@1952
   108
ds@1952
   109
/*
ds@1952
   110
** Internally, the vdbe manipulates nearly all SQL values as Mem
ds@1952
   111
** structures. Each Mem struct may cache multiple representations (string,
ds@1952
   112
** integer etc.) of the same value.  A value (and therefore Mem structure)
ds@1952
   113
** has the following properties:
ds@1952
   114
**
ds@1952
   115
** Each value has a manifest type. The manifest type of the value stored
ds@1952
   116
** in a Mem struct is returned by the MemType(Mem*) macro. The type is
ds@1952
   117
** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or
ds@1952
   118
** SQLITE_BLOB.
ds@1952
   119
*/
ds@1952
   120
struct Mem {
ds@1952
   121
  union {
ds@1952
   122
    i64 i;              /* Integer value. Or FuncDef* when flags==MEM_Agg */
ds@1952
   123
    FuncDef *pDef;      /* Used only when flags==MEM_Agg */
ds@1952
   124
  } u;
ds@1952
   125
  double r;           /* Real value */
ds@1952
   126
  sqlite3 *db;        /* The associated database connection */
ds@1952
   127
  char *z;            /* String or BLOB value */
ds@1952
   128
  int n;              /* Number of characters in string value, including '\0' */
ds@1952
   129
  u16 flags;          /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
ds@1952
   130
  u8  type;           /* One of SQLITE_NULL, SQLITE_TEXT, SQLITE_INTEGER, etc */
ds@1952
   131
  u8  enc;            /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
ds@1952
   132
  void (*xDel)(void *);  /* If not null, call this function to delete Mem.z */
ds@1952
   133
  char zShort[NBFS];  /* Space for short strings */
ds@1952
   134
};
ds@1952
   135
typedef struct Mem Mem;
ds@1952
   136
ds@1952
   137
/* One or more of the following flags are set to indicate the validOK
ds@1952
   138
** representations of the value stored in the Mem struct.
ds@1952
   139
**
ds@1952
   140
** If the MEM_Null flag is set, then the value is an SQL NULL value.
ds@1952
   141
** No other flags may be set in this case.
ds@1952
   142
**
ds@1952
   143
** If the MEM_Str flag is set then Mem.z points at a string representation.
ds@1952
   144
** Usually this is encoded in the same unicode encoding as the main
ds@1952
   145
** database (see below for exceptions). If the MEM_Term flag is also
ds@1952
   146
** set, then the string is nul terminated. The MEM_Int and MEM_Real 
ds@1952
   147
** flags may coexist with the MEM_Str flag.
ds@1952
   148
**
ds@1952
   149
** Multiple of these values can appear in Mem.flags.  But only one
ds@1952
   150
** at a time can appear in Mem.type.
ds@1952
   151
*/
ds@1952
   152
#define MEM_Null      0x0001   /* Value is NULL */
ds@1952
   153
#define MEM_Str       0x0002   /* Value is a string */
ds@1952
   154
#define MEM_Int       0x0004   /* Value is an integer */
ds@1952
   155
#define MEM_Real      0x0008   /* Value is a real number */
ds@1952
   156
#define MEM_Blob      0x0010   /* Value is a BLOB */
ds@1952
   157
ds@1952
   158
/* Whenever Mem contains a valid string or blob representation, one of
ds@1952
   159
** the following flags must be set to determine the memory management
ds@1952
   160
** policy for Mem.z.  The MEM_Term flag tells us whether or not the
ds@1952
   161
** string is \000 or \u0000 terminated
ds@1952
   162
*/
ds@1952
   163
#define MEM_Term      0x0020   /* String rep is nul terminated */
ds@1952
   164
#define MEM_Dyn       0x0040   /* Need to call sqliteFree() on Mem.z */
ds@1952
   165
#define MEM_Static    0x0080   /* Mem.z points to a static string */
ds@1952
   166
#define MEM_Ephem     0x0100   /* Mem.z points to an ephemeral string */
ds@1952
   167
#define MEM_Short     0x0200   /* Mem.z points to Mem.zShort */
ds@1952
   168
#define MEM_Agg       0x0400   /* Mem.z points to an agg function context */
ds@1952
   169
#define MEM_Zero      0x0800   /* Mem.i contains count of 0s appended to blob */
ds@1952
   170
ds@1952
   171
#ifdef SQLITE_OMIT_INCRBLOB
ds@1952
   172
  #undef MEM_Zero
ds@1952
   173
  #define MEM_Zero 0x0000
ds@1952
   174
#endif
ds@1952
   175
ds@1952
   176
ds@1952
   177
/* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains
ds@1952
   178
** additional information about auxiliary information bound to arguments
ds@1952
   179
** of the function.  This is used to implement the sqlite3_get_auxdata()
ds@1952
   180
** and sqlite3_set_auxdata() APIs.  The "auxdata" is some auxiliary data
ds@1952
   181
** that can be associated with a constant argument to a function.  This
ds@1952
   182
** allows functions such as "regexp" to compile their constant regular
ds@1952
   183
** expression argument once and reused the compiled code for multiple
ds@1952
   184
** invocations.
ds@1952
   185
*/
ds@1952
   186
struct VdbeFunc {
ds@1952
   187
  FuncDef *pFunc;               /* The definition of the function */
ds@1952
   188
  int nAux;                     /* Number of entries allocated for apAux[] */
ds@1952
   189
  struct AuxData {
ds@1952
   190
    void *pAux;                   /* Aux data for the i-th argument */
ds@1952
   191
    void (*xDelete)(void *);      /* Destructor for the aux data */
ds@1952
   192
  } apAux[1];                   /* One slot for each function argument */
ds@1952
   193
};
ds@1952
   194
typedef struct VdbeFunc VdbeFunc;
ds@1952
   195
ds@1952
   196
/*
ds@1952
   197
** The "context" argument for a installable function.  A pointer to an
ds@1952
   198
** instance of this structure is the first argument to the routines used
ds@1952
   199
** implement the SQL functions.
ds@1952
   200
**
ds@1952
   201
** There is a typedef for this structure in sqlite.h.  So all routines,
ds@1952
   202
** even the public interface to SQLite, can use a pointer to this structure.
ds@1952
   203
** But this file is the only place where the internal details of this
ds@1952
   204
** structure are known.
ds@1952
   205
**
ds@1952
   206
** This structure is defined inside of vdbeInt.h because it uses substructures
ds@1952
   207
** (Mem) which are only defined there.
ds@1952
   208
*/
ds@1952
   209
struct sqlite3_context {
ds@1952
   210
  FuncDef *pFunc;       /* Pointer to function information.  MUST BE FIRST */
ds@1952
   211
  VdbeFunc *pVdbeFunc;  /* Auxilary data, if created. */
ds@1952
   212
  Mem s;                /* The return value is stored here */
ds@1952
   213
  Mem *pMem;            /* Memory cell used to store aggregate context */
ds@1952
   214
  u8 isError;           /* Set to true for an error */
ds@1952
   215
  CollSeq *pColl;       /* Collating sequence */
ds@1952
   216
};
ds@1952
   217
ds@1952
   218
/*
ds@1952
   219
** A Set structure is used for quick testing to see if a value
ds@1952
   220
** is part of a small set.  Sets are used to implement code like
ds@1952
   221
** this:
ds@1952
   222
**            x.y IN ('hi','hoo','hum')
ds@1952
   223
*/
ds@1952
   224
typedef struct Set Set;
ds@1952
   225
struct Set {
ds@1952
   226
  Hash hash;             /* A set is just a hash table */
ds@1952
   227
  HashElem *prev;        /* Previously accessed hash elemen */
ds@1952
   228
};
ds@1952
   229
ds@1952
   230
/*
ds@1952
   231
** A FifoPage structure holds a single page of valves.  Pages are arranged
ds@1952
   232
** in a list.
ds@1952
   233
*/
ds@1952
   234
typedef struct FifoPage FifoPage;
ds@1952
   235
struct FifoPage {
ds@1952
   236
  int nSlot;         /* Number of entries aSlot[] */
ds@1952
   237
  int iWrite;        /* Push the next value into this entry in aSlot[] */
ds@1952
   238
  int iRead;         /* Read the next value from this entry in aSlot[] */
ds@1952
   239
  FifoPage *pNext;   /* Next page in the fifo */
ds@1952
   240
  i64 aSlot[1];      /* One or more slots for rowid values */
ds@1952
   241
};
ds@1952
   242
ds@1952
   243
/*
ds@1952
   244
** The Fifo structure is typedef-ed in vdbeInt.h.  But the implementation
ds@1952
   245
** of that structure is private to this file.
ds@1952
   246
**
ds@1952
   247
** The Fifo structure describes the entire fifo.  
ds@1952
   248
*/
ds@1952
   249
typedef struct Fifo Fifo;
ds@1952
   250
struct Fifo {
ds@1952
   251
  int nEntry;         /* Total number of entries */
ds@1952
   252
  FifoPage *pFirst;   /* First page on the list */
ds@1952
   253
  FifoPage *pLast;    /* Last page on the list */
ds@1952
   254
};
ds@1952
   255
ds@1952
   256
/*
ds@1952
   257
** A Context stores the last insert rowid, the last statement change count,
ds@1952
   258
** and the current statement change count (i.e. changes since last statement).
ds@1952
   259
** The current keylist is also stored in the context.
ds@1952
   260
** Elements of Context structure type make up the ContextStack, which is
ds@1952
   261
** updated by the ContextPush and ContextPop opcodes (used by triggers).
ds@1952
   262
** The context is pushed before executing a trigger a popped when the
ds@1952
   263
** trigger finishes.
ds@1952
   264
*/
ds@1952
   265
typedef struct Context Context;
ds@1952
   266
struct Context {
ds@1952
   267
  i64 lastRowid;    /* Last insert rowid (sqlite3.lastRowid) */
ds@1952
   268
  int nChange;      /* Statement changes (Vdbe.nChanges)     */
ds@1952
   269
  Fifo sFifo;       /* Records that will participate in a DELETE or UPDATE */
ds@1952
   270
};
ds@1952
   271
ds@1952
   272
/*
ds@1952
   273
** An instance of the virtual machine.  This structure contains the complete
ds@1952
   274
** state of the virtual machine.
ds@1952
   275
**
ds@1952
   276
** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile()
ds@1952
   277
** is really a pointer to an instance of this structure.
ds@1952
   278
**
ds@1952
   279
** The Vdbe.inVtabMethod variable is set to non-zero for the duration of
ds@1952
   280
** any virtual table method invocations made by the vdbe program. It is
ds@1952
   281
** set to 2 for xDestroy method calls and 1 for all other methods. This
ds@1952
   282
** variable is used for two purposes: to allow xDestroy methods to execute
ds@1952
   283
** "DROP TABLE" statements and to prevent some nasty side effects of
ds@1952
   284
** malloc failure when SQLite is invoked recursively by a virtual table 
ds@1952
   285
** method function.
ds@1952
   286
*/
ds@1952
   287
struct Vdbe {
ds@1952
   288
  sqlite3 *db;        /* The whole database */
ds@1952
   289
  Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
ds@1952
   290
  int nOp;            /* Number of instructions in the program */
ds@1952
   291
  int nOpAlloc;       /* Number of slots allocated for aOp[] */
ds@1952
   292
  Op *aOp;            /* Space to hold the virtual machine's program */
ds@1952
   293
  int nLabel;         /* Number of labels used */
ds@1952
   294
  int nLabelAlloc;    /* Number of slots allocated in aLabel[] */
ds@1952
   295
  int *aLabel;        /* Space to hold the labels */
ds@1952
   296
  Mem *aStack;        /* The operand stack, except string values */
ds@1952
   297
  Mem *pTos;          /* Top entry in the operand stack */
ds@1952
   298
  Mem **apArg;        /* Arguments to currently executing user function */
ds@1952
   299
  Mem *aColName;      /* Column names to return */
ds@1952
   300
  int nCursor;        /* Number of slots in apCsr[] */
ds@1952
   301
  Cursor **apCsr;     /* One element of this array for each open cursor */
ds@1952
   302
  int nVar;           /* Number of entries in aVar[] */
ds@1952
   303
  Mem *aVar;          /* Values for the OP_Variable opcode. */
ds@1952
   304
  char **azVar;       /* Name of variables */
ds@1952
   305
  int okVar;          /* True if azVar[] has been initialized */
ds@1952
   306
  int magic;              /* Magic number for sanity checking */
ds@1952
   307
  int nMem;               /* Number of memory locations currently allocated */
ds@1952
   308
  Mem *aMem;              /* The memory locations */
ds@1952
   309
  int nCallback;          /* Number of callbacks invoked so far */
ds@1952
   310
  int cacheCtr;           /* Cursor row cache generation counter */
ds@1952
   311
  Fifo sFifo;             /* A list of ROWIDs */
ds@1952
   312
  int contextStackTop;    /* Index of top element in the context stack */
ds@1952
   313
  int contextStackDepth;  /* The size of the "context" stack */
ds@1952
   314
  Context *contextStack;  /* Stack used by opcodes ContextPush & ContextPop*/
ds@1952
   315
  int pc;                 /* The program counter */
ds@1952
   316
  int rc;                 /* Value to return */
ds@1952
   317
  unsigned uniqueCnt;     /* Used by OP_MakeRecord when P2!=0 */
ds@1952
   318
  int errorAction;        /* Recovery action to do in case of an error */
ds@1952
   319
  int inTempTrans;        /* True if temp database is transactioned */
ds@1952
   320
  int returnStack[25];    /* Return address stack for OP_Gosub & OP_Return */
ds@1952
   321
  int returnDepth;        /* Next unused element in returnStack[] */
ds@1952
   322
  int nResColumn;         /* Number of columns in one row of the result set */
ds@1952
   323
  char **azResColumn;     /* Values for one row of result */ 
ds@1952
   324
  int popStack;           /* Pop the stack this much on entry to VdbeExec() */
ds@1952
   325
  char *zErrMsg;          /* Error message written here */
ds@1952
   326
  u8 resOnStack;          /* True if there are result values on the stack */
ds@1952
   327
  u8 explain;             /* True if EXPLAIN present on SQL command */
ds@1952
   328
  u8 changeCntOn;         /* True to update the change-counter */
ds@1952
   329
  u8 aborted;             /* True if ROLLBACK in another VM causes an abort */
ds@1952
   330
  u8 expired;             /* True if the VM needs to be recompiled */
ds@1952
   331
  u8 minWriteFileFormat;  /* Minimum file format for writable database files */
ds@1952
   332
  u8 inVtabMethod;        /* See comments above */
ds@1952
   333
  int nChange;            /* Number of db changes made since last reset */
ds@1952
   334
  i64 startTime;          /* Time when query started - used for profiling */
ds@1952
   335
  int btreeMask;          /* Bitmask of db->aDb[] entries referenced */
ds@1952
   336
  BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */
ds@1952
   337
  int nSql;             /* Number of bytes in zSql */
ds@1952
   338
  char *zSql;           /* Text of the SQL statement that generated this */
ds@1952
   339
#ifdef SQLITE_DEBUG
ds@1952
   340
  FILE *trace;        /* Write an execution trace here, if not NULL */
ds@1952
   341
#endif
ds@1952
   342
  int openedStatement;  /* True if this VM has opened a statement journal */
ds@1952
   343
#ifdef SQLITE_SSE
ds@1952
   344
  int fetchId;          /* Statement number used by sqlite3_fetch_statement */
ds@1952
   345
  int lru;              /* Counter used for LRU cache replacement */
ds@1952
   346
#endif
ds@1952
   347
};
ds@1952
   348
ds@1952
   349
/*
ds@1952
   350
** The following are allowed values for Vdbe.magic
ds@1952
   351
*/
ds@1952
   352
#define VDBE_MAGIC_INIT     0x26bceaa5    /* Building a VDBE program */
ds@1952
   353
#define VDBE_MAGIC_RUN      0xbdf20da3    /* VDBE is ready to execute */
ds@1952
   354
#define VDBE_MAGIC_HALT     0x519c2973    /* VDBE has completed execution */
ds@1952
   355
#define VDBE_MAGIC_DEAD     0xb606c3c8    /* The VDBE has been deallocated */
ds@1952
   356
ds@1952
   357
/*
ds@1952
   358
** Function prototypes
ds@1952
   359
*/
ds@1952
   360
void sqlite3VdbeFreeCursor(Vdbe *, Cursor*);
ds@1952
   361
void sqliteVdbePopStack(Vdbe*,int);
ds@1952
   362
int sqlite3VdbeCursorMoveto(Cursor*);
ds@1952
   363
#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
ds@1952
   364
void sqlite3VdbePrintOp(FILE*, int, Op*);
ds@1952
   365
#endif
ds@1952
   366
int sqlite3VdbeSerialTypeLen(u32);
ds@1952
   367
u32 sqlite3VdbeSerialType(Mem*, int);
ds@1952
   368
int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int);
ds@1952
   369
int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
ds@1952
   370
void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
ds@1952
   371
ds@1952
   372
int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
ds@1952
   373
int sqlite3VdbeIdxKeyCompare(Cursor*,int,const unsigned char*,int*);
ds@1952
   374
int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
ds@1952
   375
int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
ds@1952
   376
int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*);
ds@1952
   377
int sqlite3VdbeIdxRowidLen(const u8*);
ds@1952
   378
int sqlite3VdbeExec(Vdbe*);
ds@1952
   379
int sqlite3VdbeList(Vdbe*);
ds@1952
   380
int sqlite3VdbeHalt(Vdbe*);
ds@1952
   381
int sqlite3VdbeChangeEncoding(Mem *, int);
ds@1952
   382
int sqlite3VdbeMemTooBig(Mem*);
ds@1952
   383
int sqlite3VdbeMemCopy(Mem*, const Mem*);
ds@1952
   384
void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
ds@1952
   385
int sqlite3VdbeMemMove(Mem*, Mem*);
ds@1952
   386
int sqlite3VdbeMemNulTerminate(Mem*);
ds@1952
   387
int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
ds@1952
   388
void sqlite3VdbeMemSetInt64(Mem*, i64);
ds@1952
   389
void sqlite3VdbeMemSetDouble(Mem*, double);
ds@1952
   390
void sqlite3VdbeMemSetNull(Mem*);
ds@1952
   391
void sqlite3VdbeMemSetZeroBlob(Mem*,int);
ds@1952
   392
int sqlite3VdbeMemMakeWriteable(Mem*);
ds@1952
   393
int sqlite3VdbeMemDynamicify(Mem*);
ds@1952
   394
int sqlite3VdbeMemStringify(Mem*, int);
ds@1952
   395
i64 sqlite3VdbeIntValue(Mem*);
ds@1952
   396
int sqlite3VdbeMemIntegerify(Mem*);
ds@1952
   397
double sqlite3VdbeRealValue(Mem*);
ds@1952
   398
void sqlite3VdbeIntegerAffinity(Mem*);
ds@1952
   399
int sqlite3VdbeMemRealify(Mem*);
ds@1952
   400
int sqlite3VdbeMemNumerify(Mem*);
ds@1952
   401
int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
ds@1952
   402
void sqlite3VdbeMemRelease(Mem *p);
ds@1952
   403
int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
ds@1952
   404
const char *sqlite3OpcodeName(int);
ds@1952
   405
ds@1952
   406
#ifndef NDEBUG
ds@1952
   407
  void sqlite3VdbeMemSanity(Mem*);
ds@1952
   408
  int sqlite3VdbeOpcodeNoPush(u8);
ds@1952
   409
#endif
ds@1952
   410
int sqlite3VdbeMemTranslate(Mem*, u8);
ds@1952
   411
#ifdef SQLITE_DEBUG
ds@1952
   412
  void sqlite3VdbePrintSql(Vdbe*);
ds@1952
   413
  void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
ds@1952
   414
#endif
ds@1952
   415
int sqlite3VdbeMemHandleBom(Mem *pMem);
ds@1952
   416
void sqlite3VdbeFifoInit(Fifo*);
ds@1952
   417
int sqlite3VdbeFifoPush(Fifo*, i64);
ds@1952
   418
int sqlite3VdbeFifoPop(Fifo*, i64*);
ds@1952
   419
void sqlite3VdbeFifoClear(Fifo*);
ds@1952
   420
ds@1952
   421
#ifndef SQLITE_OMIT_INCRBLOB
ds@1952
   422
  int sqlite3VdbeMemExpandBlob(Mem *);
ds@1952
   423
#else
ds@1952
   424
  #define sqlite3VdbeMemExpandBlob(x) SQLITE_OK
ds@1952
   425
#endif
ds@1952
   426
ds@1952
   427
#endif /* !defined(_VDBEINT_H_) */