Back to index

lightning-sunbird  0.9+nobinonly
Functions
vdbeapi.c File Reference
#include "sqliteInt.h"
#include "vdbeInt.h"
#include "os.h"

Go to the source code of this file.

Functions

int sqlite3_expired (sqlite3_stmt *pStmt)
const voidsqlite3_value_blob (sqlite3_value *pVal)
int sqlite3_value_bytes (sqlite3_value *pVal)
int sqlite3_value_bytes16 (sqlite3_value *pVal)
double sqlite3_value_double (sqlite3_value *pVal)
int sqlite3_value_int (sqlite3_value *pVal)
sqlite_int64 sqlite3_value_int64 (sqlite3_value *pVal)
const unsigned char * sqlite3_value_text (sqlite3_value *pVal)
const voidsqlite3_value_text16 (sqlite3_value *pVal)
const voidsqlite3_value_text16be (sqlite3_value *pVal)
const voidsqlite3_value_text16le (sqlite3_value *pVal)
int sqlite3_value_type (sqlite3_value *pVal)
void sqlite3_result_blob (sqlite3_context *pCtx, const void *z, int n, void(*xDel)(void *))
void sqlite3_result_double (sqlite3_context *pCtx, double rVal)
void sqlite3_result_error (sqlite3_context *pCtx, const char *z, int n)
void sqlite3_result_error16 (sqlite3_context *pCtx, const void *z, int n)
void sqlite3_result_int (sqlite3_context *pCtx, int iVal)
void sqlite3_result_int64 (sqlite3_context *pCtx, i64 iVal)
void sqlite3_result_null (sqlite3_context *pCtx)
void sqlite3_result_text (sqlite3_context *pCtx, const char *z, int n, void(*xDel)(void *))
void sqlite3_result_text16 (sqlite3_context *pCtx, const void *z, int n, void(*xDel)(void *))
void sqlite3_result_text16be (sqlite3_context *pCtx, const void *z, int n, void(*xDel)(void *))
void sqlite3_result_text16le (sqlite3_context *pCtx, const void *z, int n, void(*xDel)(void *))
void sqlite3_result_value (sqlite3_context *pCtx, sqlite3_value *pValue)
int sqlite3_step (sqlite3_stmt *pStmt)
voidsqlite3_user_data (sqlite3_context *p)
voidsqlite3_aggregate_context (sqlite3_context *p, int nByte)
voidsqlite3_get_auxdata (sqlite3_context *pCtx, int iArg)
void sqlite3_set_auxdata (sqlite3_context *pCtx, int iArg, void *pAux, void(*xDelete)(void *))
int sqlite3_aggregate_count (sqlite3_context *p)
int sqlite3_column_count (sqlite3_stmt *pStmt)
int sqlite3_data_count (sqlite3_stmt *pStmt)
static MemcolumnMem (sqlite3_stmt *pStmt, int i)
static void columnMallocFailure (sqlite3_stmt *pStmt)
const voidsqlite3_column_blob (sqlite3_stmt *pStmt, int i)
int sqlite3_column_bytes (sqlite3_stmt *pStmt, int i)
int sqlite3_column_bytes16 (sqlite3_stmt *pStmt, int i)
double sqlite3_column_double (sqlite3_stmt *pStmt, int i)
int sqlite3_column_int (sqlite3_stmt *pStmt, int i)
sqlite_int64 sqlite3_column_int64 (sqlite3_stmt *pStmt, int i)
const unsigned char * sqlite3_column_text (sqlite3_stmt *pStmt, int i)
const voidsqlite3_column_text16 (sqlite3_stmt *pStmt, int i)
int sqlite3_column_type (sqlite3_stmt *pStmt, int i)
static const voidcolumnName (sqlite3_stmt *pStmt, int N, const void *(*xFunc)(Mem *), int useType)
const char * sqlite3_column_name (sqlite3_stmt *pStmt, int N)
const voidsqlite3_column_name16 (sqlite3_stmt *pStmt, int N)
const char * sqlite3_column_decltype (sqlite3_stmt *pStmt, int N)
const voidsqlite3_column_decltype16 (sqlite3_stmt *pStmt, int N)
static int vdbeUnbind (Vdbe *p, int i)
static int bindText (sqlite3_stmt *pStmt, int i, const void *zData, int nData, void(*xDel)(void *), int encoding)
int sqlite3_bind_blob (sqlite3_stmt *pStmt, int i, const void *zData, int nData, void(*xDel)(void *))
int sqlite3_bind_double (sqlite3_stmt *pStmt, int i, double rValue)
int sqlite3_bind_int (sqlite3_stmt *p, int i, int iValue)
int sqlite3_bind_int64 (sqlite3_stmt *pStmt, int i, sqlite_int64 iValue)
int sqlite3_bind_null (sqlite3_stmt *p, int i)
int sqlite3_bind_text (sqlite3_stmt *pStmt, int i, const char *zData, int nData, void(*xDel)(void *))
int sqlite3_bind_text16 (sqlite3_stmt *pStmt, int i, const void *zData, int nData, void(*xDel)(void *))
int sqlite3_bind_parameter_count (sqlite3_stmt *pStmt)
static void createVarMap (Vdbe *p)
const char * sqlite3_bind_parameter_name (sqlite3_stmt *pStmt, int i)
int sqlite3_bind_parameter_index (sqlite3_stmt *pStmt, const char *zName)
int sqlite3_bind_parameter_indexes (sqlite3_stmt *pStmt, const char *zName, int **pIndexes)
void sqlite3_free_parameter_indexes (int *pIndexes)
int sqlite3_transfer_bindings (sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt)
sqlite3sqlite3_db_handle (sqlite3_stmt *pStmt)

Function Documentation

static int bindText ( sqlite3_stmt pStmt,
int  i,
const void zData,
int  nData,
void(*)(void *)  xDel,
int  encoding 
) [static]

Definition at line 633 of file vdbeapi.c.

 {
  Vdbe *p = (Vdbe *)pStmt;
  Mem *pVar;
  int rc;

  rc = vdbeUnbind(p, i);
  if( rc || zData==0 ){
    return rc;
  }
  pVar = &p->aVar[i-1];
  rc = sqlite3VdbeMemSetStr(pVar, zData, nData, encoding, xDel);
  if( rc==SQLITE_OK && encoding!=0 ){
    rc = sqlite3VdbeChangeEncoding(pVar, ENC(p->db));
  }

  sqlite3Error(((Vdbe *)pStmt)->db, rc, 0);
  return sqlite3ApiExit(((Vdbe *)pStmt)->db, rc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void columnMallocFailure ( sqlite3_stmt pStmt) [static]

Definition at line 405 of file vdbeapi.c.

{
  /* If malloc() failed during an encoding conversion within an
  ** sqlite3_column_XXX API, then set the return code of the statement to
  ** SQLITE_NOMEM. The next call to _step() (if any) will return SQLITE_ERROR
  ** and _finalize() will return NOMEM.
  */
  Vdbe *p = (Vdbe *)pStmt;
  p->rc = sqlite3ApiExit(0, p->rc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static Mem* columnMem ( sqlite3_stmt pStmt,
int  i 
) [static]

Definition at line 374 of file vdbeapi.c.

                                                 {
  Vdbe *pVm = (Vdbe *)pStmt;
  int vals = sqlite3_data_count(pStmt);
  if( i>=vals || i<0 ){
    static Mem nullMem;
    if( nullMem.flags==0 ){ nullMem.flags = MEM_Null; }
    sqlite3Error(pVm->db, SQLITE_RANGE, 0);
    return &nullMem;
  }
  return &pVm->pTos[(1-vals)+i];
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const void* columnName ( sqlite3_stmt pStmt,
int  N,
const void *(*)(Mem *)  xFunc,
int  useType 
) [static]

Definition at line 496 of file vdbeapi.c.

 {
  const void *ret;
  Vdbe *p = (Vdbe *)pStmt;
  int n = sqlite3_column_count(pStmt);

  if( p==0 || N>=n || N<0 ){
    return 0;
  }
  N += useType*n;
  ret = xFunc(&p->aColName[N]);

  /* A malloc may have failed inside of the xFunc() call. If this is the case,
  ** clear the mallocFailed flag and return NULL.
  */
  sqlite3ApiExit(0, 0);
  return ret;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void createVarMap ( Vdbe p) [static]

Definition at line 731 of file vdbeapi.c.

                                 {
  if( !p->okVar ){
    int j;
    Op *pOp;
    for(j=0, pOp=p->aOp; j<p->nOp; j++, pOp++){
      if( pOp->opcode==OP_Variable ){
        assert( pOp->p1>0 && pOp->p1<=p->nVar );
        p->azVar[pOp->p1-1] = pOp->p3;
      }
    }
    p->okVar = 1;
  }
}

Here is the caller graph for this function:

Definition at line 266 of file vdbeapi.c.

                                                              {
  Mem *pMem = p->pMem;
  assert( p && p->pFunc && p->pFunc->xStep );
  if( (pMem->flags & MEM_Agg)==0 ){
    if( nByte==0 ){
      assert( pMem->flags==MEM_Null );
      pMem->z = 0;
    }else{
      pMem->flags = MEM_Agg;
      pMem->xDel = sqlite3FreeX;
      *(FuncDef**)&pMem->i = p->pFunc;
      if( nByte<=NBFS ){
        pMem->z = pMem->zShort;
        memset(pMem->z, 0, nByte);
      }else{
        pMem->z = sqliteMalloc( nByte );
      }
    }
  }
  return (void*)pMem->z;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 344 of file vdbeapi.c.

                                               {
  assert( p && p->pFunc && p->pFunc->xStep );
  return p->pMem->n;
}

Here is the caller graph for this function:

int sqlite3_bind_blob ( sqlite3_stmt pStmt,
int  i,
const void zData,
int  nData,
void(*)(void *)  xDel 
)

Definition at line 663 of file vdbeapi.c.

 {
  return bindText(pStmt, i, zData, nData, xDel, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_bind_double ( sqlite3_stmt pStmt,
int  i,
double  rValue 
)

Definition at line 672 of file vdbeapi.c.

                                                                  {
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
  }
  return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_bind_int ( sqlite3_stmt p,
int  i,
int  iValue 
)

Definition at line 681 of file vdbeapi.c.

                                                        {
  return sqlite3_bind_int64(p, i, (i64)iValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_bind_int64 ( sqlite3_stmt pStmt,
int  i,
sqlite_int64  iValue 
)

Definition at line 684 of file vdbeapi.c.

                                                                       {
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
  }
  return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 693 of file vdbeapi.c.

                                             {
  return vdbeUnbind((Vdbe *)p, i);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 721 of file vdbeapi.c.

                                                     {
  Vdbe *p = (Vdbe*)pStmt;
  return p ? p->nVar : 0;
}

Here is the caller graph for this function:

int sqlite3_bind_parameter_index ( sqlite3_stmt pStmt,
const char *  zName 
)

Definition at line 765 of file vdbeapi.c.

                                                                        {
  Vdbe *p = (Vdbe*)pStmt;
  int i;
  if( p==0 ){
    return 0;
  }
  createVarMap(p); 
  if( zName ){
    for(i=0; i<p->nVar; i++){
      const char *z = p->azVar[i];
      if( z && strcmp(z,zName)==0 ){
        return i+1;
      }
    }
  }
  return 0;
}

Here is the call graph for this function:

int sqlite3_bind_parameter_indexes ( sqlite3_stmt pStmt,
const char *  zName,
int **  pIndexes 
)

Definition at line 790 of file vdbeapi.c.

 {
  Vdbe *p = (Vdbe*)pStmt;
  int i, j, nVars, *indexes;
  if( p==0 ){
    return 0;
  }
  createVarMap(p);
  if( !zName )
    return 0;
  /* first count */
  nVars = 0;
  for(i=0; i<p->nVar; i++){
    const char *z = p->azVar[i];
    if( z && strcmp(z,zName)==0 ){
      nVars++;
    }
  }
  indexes = sqliteMalloc( sizeof(int) * nVars );
  j = 0;
  for(i=0; i<p->nVar; i++){
    const char *z = p->azVar[i];
    if( z && strcmp(z,zName)==0 )
      indexes[j++] = i+1;
  }
  *pIndexes = indexes;
  return nVars;
}

Here is the call graph for this function:

const char* sqlite3_bind_parameter_name ( sqlite3_stmt pStmt,
int  i 
)

Definition at line 751 of file vdbeapi.c.

                                                                   {
  Vdbe *p = (Vdbe*)pStmt;
  if( p==0 || i<1 || i>p->nVar ){
    return 0;
  }
  createVarMap(p);
  return p->azVar[i-1];
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_bind_text ( sqlite3_stmt pStmt,
int  i,
const char *  zData,
int  nData,
void(*)(void *)  xDel 
)

Definition at line 696 of file vdbeapi.c.

 {
  return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_bind_text16 ( sqlite3_stmt pStmt,
int  i,
const void zData,
int  nData,
void(*)(void *)  xDel 
)

Definition at line 706 of file vdbeapi.c.

 {
  return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
}

Here is the call graph for this function:

Definition at line 420 of file vdbeapi.c.

                                                           {
  const void *val;
  sqlite3MallocDisallow();
  val = sqlite3_value_blob( columnMem(pStmt,i) );
  sqlite3MallocAllow();
  return val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_column_bytes ( sqlite3_stmt pStmt,
int  i 
)

Definition at line 427 of file vdbeapi.c.

                                                    {
  int val = sqlite3_value_bytes( columnMem(pStmt,i) );
  columnMallocFailure(pStmt);
  return val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 432 of file vdbeapi.c.

                                                      {
  int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
  columnMallocFailure(pStmt);
  return val;
}

Here is the call graph for this function:

Definition at line 352 of file vdbeapi.c.

                                             {
  Vdbe *pVm = (Vdbe *)pStmt;
  return pVm ? pVm->nResColumn : 0;
}

Here is the caller graph for this function:

const char* sqlite3_column_decltype ( sqlite3_stmt pStmt,
int  N 
)

Definition at line 538 of file vdbeapi.c.

                                                               {
  return columnName(
      pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE);
}

Here is the call graph for this function:

Definition at line 543 of file vdbeapi.c.

                                                                 {
  return columnName(
      pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE);
}

Here is the call graph for this function:

double sqlite3_column_double ( sqlite3_stmt pStmt,
int  i 
)

Definition at line 437 of file vdbeapi.c.

                                                        {
  double val = sqlite3_value_double( columnMem(pStmt,i) );
  columnMallocFailure(pStmt);
  return val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_column_int ( sqlite3_stmt pStmt,
int  i 
)

Definition at line 442 of file vdbeapi.c.

                                                  {
  int val = sqlite3_value_int( columnMem(pStmt,i) );
  columnMallocFailure(pStmt);
  return val;
}

Here is the call graph for this function:

Definition at line 447 of file vdbeapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

const char* sqlite3_column_name ( sqlite3_stmt pStmt,
int  N 
)

Definition at line 523 of file vdbeapi.c.

                                                           {
  return columnName(
      pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 528 of file vdbeapi.c.

                                                             {
  return columnName(
      pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME);
}

Here is the call graph for this function:

const unsigned char* sqlite3_column_text ( sqlite3_stmt pStmt,
int  i 
)

Definition at line 452 of file vdbeapi.c.

                                                                    {
  const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
  columnMallocFailure(pStmt);
  return val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 463 of file vdbeapi.c.

                                                             {
  const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
  columnMallocFailure(pStmt);
  return val;
}

Here is the call graph for this function:

int sqlite3_column_type ( sqlite3_stmt pStmt,
int  i 
)

Definition at line 469 of file vdbeapi.c.

                                                   {
  return sqlite3_value_type( columnMem(pStmt,i) );
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 361 of file vdbeapi.c.

                                           {
  Vdbe *pVm = (Vdbe *)pStmt;
  if( pVm==0 || !pVm->resOnStack ) return 0;
  return pVm->nResColumn;
}

Here is the caller graph for this function:

Definition at line 857 of file vdbeapi.c.

                                               {
  return pStmt ? ((Vdbe*)pStmt)->db : 0;
}

Definition at line 28 of file vdbeapi.c.

                                        {
  Vdbe *p = (Vdbe*)pStmt;
  return p==0 || p->expired;
}

Here is the caller graph for this function:

Definition at line 822 of file vdbeapi.c.

{
  sqliteFree( pIndexes );
}
void* sqlite3_get_auxdata ( sqlite3_context pCtx,
int  iArg 
)

Definition at line 292 of file vdbeapi.c.

                                                          {
  VdbeFunc *pVdbeFunc = pCtx->pVdbeFunc;
  if( !pVdbeFunc || iArg>=pVdbeFunc->nAux || iArg<0 ){
    return 0;
  }
  return pVdbeFunc->apAux[iArg].pAux;
}
void sqlite3_result_blob ( sqlite3_context pCtx,
const void z,
int  n,
void(*)(void *)  xDel 
)

Definition at line 83 of file vdbeapi.c.

 {
  assert( n>=0 );
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, 0, xDel);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_result_double ( sqlite3_context pCtx,
double  rVal 
)

Definition at line 92 of file vdbeapi.c.

                                                              {
  sqlite3VdbeMemSetDouble(&pCtx->s, rVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_result_error ( sqlite3_context pCtx,
const char *  z,
int  n 
)

Definition at line 95 of file vdbeapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 100 of file vdbeapi.c.

Here is the call graph for this function:

void sqlite3_result_int ( sqlite3_context pCtx,
int  iVal 
)

Definition at line 105 of file vdbeapi.c.

                                                        {
  sqlite3VdbeMemSetInt64(&pCtx->s, (i64)iVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_result_int64 ( sqlite3_context pCtx,
i64  iVal 
)

Definition at line 108 of file vdbeapi.c.

                                                          {
  sqlite3VdbeMemSetInt64(&pCtx->s, iVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 111 of file vdbeapi.c.

                                               {
  sqlite3VdbeMemSetNull(&pCtx->s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_result_text ( sqlite3_context pCtx,
const char *  z,
int  n,
void(*)(void *)  xDel 
)

Definition at line 114 of file vdbeapi.c.

 {
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, xDel);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_result_text16 ( sqlite3_context pCtx,
const void z,
int  n,
void(*)(void *)  xDel 
)

Definition at line 123 of file vdbeapi.c.

 {
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, xDel);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_result_text16be ( sqlite3_context pCtx,
const void z,
int  n,
void(*)(void *)  xDel 
)

Definition at line 131 of file vdbeapi.c.

 {
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16BE, xDel);
}

Here is the call graph for this function:

void sqlite3_result_text16le ( sqlite3_context pCtx,
const void z,
int  n,
void(*)(void *)  xDel 
)

Definition at line 139 of file vdbeapi.c.

 {
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16LE, xDel);
}

Here is the call graph for this function:

void sqlite3_result_value ( sqlite3_context pCtx,
sqlite3_value *  pValue 
)

Definition at line 148 of file vdbeapi.c.

                                                                       {
  sqlite3VdbeMemCopy(&pCtx->s, pValue);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqlite3_set_auxdata ( sqlite3_context pCtx,
int  iArg,
void pAux,
void(*)(void *)  xDelete 
)

Definition at line 305 of file vdbeapi.c.

 {
  struct AuxData *pAuxData;
  VdbeFunc *pVdbeFunc;
  if( iArg<0 ) return;

  pVdbeFunc = pCtx->pVdbeFunc;
  if( !pVdbeFunc || pVdbeFunc->nAux<=iArg ){
    int nMalloc = sizeof(VdbeFunc) + sizeof(struct AuxData)*iArg;
    pVdbeFunc = sqliteRealloc(pVdbeFunc, nMalloc);
    if( !pVdbeFunc ) return;
    pCtx->pVdbeFunc = pVdbeFunc;
    memset(&pVdbeFunc->apAux[pVdbeFunc->nAux], 0, 
             sizeof(struct AuxData)*(iArg+1-pVdbeFunc->nAux));
    pVdbeFunc->nAux = iArg+1;
    pVdbeFunc->pFunc = pCtx->pFunc;
  }

  pAuxData = &pVdbeFunc->apAux[iArg];
  if( pAuxData->pAux && pAuxData->xDelete ){
    pAuxData->xDelete(pAuxData->pAux);
  }
  pAuxData->pAux = pAux;
  pAuxData->xDelete = xDelete;
}

Here is the call graph for this function:

Definition at line 157 of file vdbeapi.c.

                                     {
  Vdbe *p = (Vdbe*)pStmt;
  sqlite3 *db;
  int rc;

  /* Assert that malloc() has not failed */
  assert( !sqlite3MallocFailed() );

  if( p==0 || p->magic!=VDBE_MAGIC_RUN ){
    return SQLITE_MISUSE;
  }
  if( p->aborted ){
    return SQLITE_ABORT;
  }
  if( p->pc<=0 && p->expired ){
    if( p->rc==SQLITE_OK ){
      p->rc = SQLITE_SCHEMA;
    }
    return SQLITE_ERROR;
  }
  db = p->db;
  if( sqlite3SafetyOn(db) ){
    p->rc = SQLITE_MISUSE;
    return SQLITE_MISUSE;
  }
  if( p->pc<0 ){
#ifndef SQLITE_OMIT_TRACE
    /* Invoke the trace callback if there is one
    */
    if( db->xTrace && !db->init.busy ){
      assert( p->nOp>0 );
      assert( p->aOp[p->nOp-1].opcode==OP_Noop );
      assert( p->aOp[p->nOp-1].p3!=0 );
      assert( p->aOp[p->nOp-1].p3type==P3_DYNAMIC );
      sqlite3SafetyOff(db);
      db->xTrace(db->pTraceArg, p->aOp[p->nOp-1].p3);
      if( sqlite3SafetyOn(db) ){
        p->rc = SQLITE_MISUSE;
        return SQLITE_MISUSE;
      }
    }
    if( db->xProfile && !db->init.busy ){
      double rNow;
      sqlite3OsCurrentTime(&rNow);
      p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0;
    }
#endif

    /* Print a copy of SQL as it is executed if the SQL_TRACE pragma is turned
    ** on in debugging mode.
    */
#ifdef SQLITE_DEBUG
    if( (db->flags & SQLITE_SqlTrace)!=0 ){
      sqlite3DebugPrintf("SQL-trace: %s\n", p->aOp[p->nOp-1].p3);
    }
#endif /* SQLITE_DEBUG */

    db->activeVdbeCnt++;
    p->pc = 0;
  }
#ifndef SQLITE_OMIT_EXPLAIN
  if( p->explain ){
    rc = sqlite3VdbeList(p);
  }else
#endif /* SQLITE_OMIT_EXPLAIN */
  {
    rc = sqlite3VdbeExec(p);
  }

  if( sqlite3SafetyOff(db) ){
    rc = SQLITE_MISUSE;
  }

#ifndef SQLITE_OMIT_TRACE
  /* Invoke the profile callback if there is one
  */
  if( rc!=SQLITE_ROW && db->xProfile && !db->init.busy ){
    double rNow;
    u64 elapseTime;

    sqlite3OsCurrentTime(&rNow);
    elapseTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0 - p->startTime;
    assert( p->nOp>0 );
    assert( p->aOp[p->nOp-1].opcode==OP_Noop );
    assert( p->aOp[p->nOp-1].p3!=0 );
    assert( p->aOp[p->nOp-1].p3type==P3_DYNAMIC );
    db->xProfile(db->pProfileArg, p->aOp[p->nOp-1].p3, elapseTime);
  }
#endif

  sqlite3Error(p->db, rc, 0);
  p->rc = sqlite3ApiExit(p->db, p->rc);
  return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_transfer_bindings ( sqlite3_stmt pFromStmt,
sqlite3_stmt pToStmt 
)

Definition at line 832 of file vdbeapi.c.

                                                                             {
  Vdbe *pFrom = (Vdbe*)pFromStmt;
  Vdbe *pTo = (Vdbe*)pToStmt;
  int i, rc = SQLITE_OK;
  if( (pFrom->magic!=VDBE_MAGIC_RUN && pFrom->magic!=VDBE_MAGIC_HALT)
    || (pTo->magic!=VDBE_MAGIC_RUN && pTo->magic!=VDBE_MAGIC_HALT) ){
    return SQLITE_MISUSE;
  }
  if( pFrom->nVar!=pTo->nVar ){
    return SQLITE_ERROR;
  }
  for(i=0; rc==SQLITE_OK && i<pFrom->nVar; i++){
    sqlite3MallocDisallow();
    rc = sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
    sqlite3MallocAllow();
  }
  return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 256 of file vdbeapi.c.

                                           {
  assert( p && p->pFunc );
  return p->pFunc->pUserData;
}

Here is the caller graph for this function:

const void* sqlite3_value_blob ( sqlite3_value *  pVal)

Definition at line 37 of file vdbeapi.c.

                                                   {
  Mem *p = (Mem*)pVal;
  if( p->flags & (MEM_Blob|MEM_Str) ){
    return p->z;
  }else{
    return sqlite3_value_text(pVal);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_value_bytes ( sqlite3_value *  pVal)

Definition at line 45 of file vdbeapi.c.

                                            {
  return sqlite3ValueBytes(pVal, SQLITE_UTF8);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_value_bytes16 ( sqlite3_value *  pVal)

Definition at line 48 of file vdbeapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

double sqlite3_value_double ( sqlite3_value *  pVal)

Definition at line 51 of file vdbeapi.c.

                                                {
  return sqlite3VdbeRealValue((Mem*)pVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqlite3_value_int ( sqlite3_value *  pVal)

Definition at line 54 of file vdbeapi.c.

                                          {
  return sqlite3VdbeIntValue((Mem*)pVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

sqlite_int64 sqlite3_value_int64 ( sqlite3_value *  pVal)

Definition at line 57 of file vdbeapi.c.

                                                     {
  return sqlite3VdbeIntValue((Mem*)pVal);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const unsigned char* sqlite3_value_text ( sqlite3_value *  pVal)

Definition at line 60 of file vdbeapi.c.

                                                            {
  return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const void* sqlite3_value_text16 ( sqlite3_value *  pVal)

Definition at line 64 of file vdbeapi.c.

Here is the call graph for this function:

Here is the caller graph for this function:

const void* sqlite3_value_text16be ( sqlite3_value *  pVal)

Definition at line 67 of file vdbeapi.c.

                                                       {
  return sqlite3ValueText(pVal, SQLITE_UTF16BE);
}

Here is the call graph for this function:

const void* sqlite3_value_text16le ( sqlite3_value *  pVal)

Definition at line 70 of file vdbeapi.c.

                                                       {
  return sqlite3ValueText(pVal, SQLITE_UTF16LE);
}

Here is the call graph for this function:

int sqlite3_value_type ( sqlite3_value *  pVal)

Definition at line 74 of file vdbeapi.c.

                                           {
  return pVal->type;
}

Here is the caller graph for this function:

static int vdbeUnbind ( Vdbe p,
int  i 
) [static]

Definition at line 612 of file vdbeapi.c.

                                     {
  Mem *pVar;
  if( p==0 || p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){
    if( p ) sqlite3Error(p->db, SQLITE_MISUSE, 0);
    return SQLITE_MISUSE;
  }
  if( i<1 || i>p->nVar ){
    sqlite3Error(p->db, SQLITE_RANGE, 0);
    return SQLITE_RANGE;
  }
  i--;
  pVar = &p->aVar[i];
  sqlite3VdbeMemRelease(pVar);
  pVar->flags = MEM_Null;
  sqlite3Error(p->db, SQLITE_OK, 0);
  return SQLITE_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function: