亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vdbeaux.c

?? sqlite 3.3.8 支持加密的版本
?? C
?? 第 1 頁 / 共 5 頁
字號:
**
** This routine is the only way to move the state of a VM from
** SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT.
**
** Return an error code.  If the commit could not complete because of
** lock contention, return SQLITE_BUSY.  If SQLITE_BUSY is returned, it
** means the close did not happen and needs to be repeated.
*/
int sqlite3VdbeHalt(Vdbe *p){
  sqlite3 *db = p->db;
  int i;
  int (*xFunc)(Btree *pBt) = 0;  /* Function to call on each btree backend */
  int isSpecialError;            /* Set to true if SQLITE_NOMEM or IOERR */

  /* This function contains the logic that determines if a statement or
  ** transaction will be committed or rolled back as a result of the
  ** execution of this virtual machine. 
  **
  ** Special errors:
  **
  **     If an SQLITE_NOMEM error has occured in a statement that writes to
  **     the database, then either a statement or transaction must be rolled
  **     back to ensure the tree-structures are in a consistent state. A
  **     statement transaction is rolled back if one is open, otherwise the
  **     entire transaction must be rolled back.
  **
  **     If an SQLITE_IOERR error has occured in a statement that writes to
  **     the database, then the entire transaction must be rolled back. The
  **     I/O error may have caused garbage to be written to the journal 
  **     file. Were the transaction to continue and eventually be rolled 
  **     back that garbage might end up in the database file.
  **     
  **     In both of the above cases, the Vdbe.errorAction variable is 
  **     ignored. If the sqlite3.autoCommit flag is false and a transaction
  **     is rolled back, it will be set to true.
  **
  ** Other errors:
  **
  ** No error:
  **
  */

  if( sqlite3MallocFailed() ){
    p->rc = SQLITE_NOMEM;
  }
  if( p->magic!=VDBE_MAGIC_RUN ){
    /* Already halted.  Nothing to do. */
    assert( p->magic==VDBE_MAGIC_HALT );
#ifndef SQLITE_OMIT_VIRTUALTABLE
    closeAllCursors(p);
#endif
    return SQLITE_OK;
  }
  closeAllCursors(p);
  checkActiveVdbeCnt(db);

  /* No commit or rollback needed if the program never started */
  if( p->pc>=0 ){
    int mrc;   /* Primary error code from p->rc */
    /* Check for one of the special errors - SQLITE_NOMEM or SQLITE_IOERR */
    mrc = p->rc & 0xff;
    isSpecialError = ((mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR)?1:0);
    if( isSpecialError ){
      /* This loop does static analysis of the query to see which of the
      ** following three categories it falls into:
      **
      **     Read-only
      **     Query with statement journal
      **     Query without statement journal
      **
      ** We could do something more elegant than this static analysis (i.e.
      ** store the type of query as part of the compliation phase), but 
      ** handling malloc() or IO failure is a fairly obscure edge case so 
      ** this is probably easier. Todo: Might be an opportunity to reduce 
      ** code size a very small amount though...
      */
      int isReadOnly = 1;
      int isStatement = 0;
      assert(p->aOp || p->nOp==0);
      for(i=0; i<p->nOp; i++){ 
        switch( p->aOp[i].opcode ){
          case OP_Transaction:
            isReadOnly = 0;
            break;
          case OP_Statement:
            isStatement = 1;
            break;
        }
      }
  
      /* If the query was read-only, we need do no rollback at all. Otherwise,
      ** proceed with the special handling.
      */
      if( !isReadOnly ){
        if( p->rc==SQLITE_NOMEM && isStatement ){
          xFunc = sqlite3BtreeRollbackStmt;
        }else{
          /* We are forced to roll back the active transaction. Before doing
          ** so, abort any other statements this handle currently has active.
          */
          sqlite3AbortOtherActiveVdbes(db, p);
          sqlite3RollbackAll(db);
          db->autoCommit = 1;
        }
      }
    }
  
    /* If the auto-commit flag is set and this is the only active vdbe, then
    ** we do either a commit or rollback of the current transaction. 
    **
    ** Note: This block also runs if one of the special errors handled 
    ** above has occured. 
    */
    if( db->autoCommit && db->activeVdbeCnt==1 ){
      if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){
	/* The auto-commit flag is true, and the vdbe program was 
        ** successful or hit an 'OR FAIL' constraint. This means a commit 
        ** is required.
        */
        int rc = vdbeCommit(db);
        if( rc==SQLITE_BUSY ){
          return SQLITE_BUSY;
        }else if( rc!=SQLITE_OK ){
          p->rc = rc;
          sqlite3RollbackAll(db);
        }else{
          sqlite3CommitInternalChanges(db);
        }
      }else{
        sqlite3RollbackAll(db);
      }
    }else if( !xFunc ){
      if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
        xFunc = sqlite3BtreeCommitStmt;
      }else if( p->errorAction==OE_Abort ){
        xFunc = sqlite3BtreeRollbackStmt;
      }else{
        sqlite3AbortOtherActiveVdbes(db, p);
        sqlite3RollbackAll(db);
        db->autoCommit = 1;
      }
    }
  
    /* If xFunc is not NULL, then it is one of sqlite3BtreeRollbackStmt or
    ** sqlite3BtreeCommitStmt. Call it once on each backend. If an error occurs
    ** and the return code is still SQLITE_OK, set the return code to the new
    ** error value.
    */
    assert(!xFunc ||
      xFunc==sqlite3BtreeCommitStmt ||
      xFunc==sqlite3BtreeRollbackStmt
    );
    for(i=0; xFunc && i<db->nDb; i++){ 
      int rc;
      Btree *pBt = db->aDb[i].pBt;
      if( pBt ){
        rc = xFunc(pBt);
        if( rc && (p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT) ){
          p->rc = rc;
          sqlite3SetString(&p->zErrMsg, 0);
        }
      }
    }
  
    /* If this was an INSERT, UPDATE or DELETE and the statement was committed, 
    ** set the change counter. 
    */
    if( p->changeCntOn && p->pc>=0 ){
      if( !xFunc || xFunc==sqlite3BtreeCommitStmt ){
        sqlite3VdbeSetChanges(db, p->nChange);
      }else{
        sqlite3VdbeSetChanges(db, 0);
      }
      p->nChange = 0;
    }
  
    /* Rollback or commit any schema changes that occurred. */
    if( p->rc!=SQLITE_OK && db->flags&SQLITE_InternChanges ){
      sqlite3ResetInternalSchema(db, 0);
      db->flags = (db->flags | SQLITE_InternChanges);
    }
  }

  /* We have successfully halted and closed the VM.  Record this fact. */
  if( p->pc>=0 ){
    db->activeVdbeCnt--;
  }
  p->magic = VDBE_MAGIC_HALT;
  checkActiveVdbeCnt(db);

  return SQLITE_OK;
}

/*
** Clean up a VDBE after execution but do not delete the VDBE just yet.
** Write any error messages into *pzErrMsg.  Return the result code.
**
** After this routine is run, the VDBE should be ready to be executed
** again.
**
** To look at it another way, this routine resets the state of the
** virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
** VDBE_MAGIC_INIT.
*/
int sqlite3VdbeReset(Vdbe *p){
  sqlite3 *db;
  if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){
    sqlite3Error(p->db, SQLITE_MISUSE, 0);
    return SQLITE_MISUSE;
  }
  db = p->db;

  /* If the VM did not run to completion or if it encountered an
  ** error, then it might not have been halted properly.  So halt
  ** it now.
  */
  sqlite3SafetyOn(db);
  sqlite3VdbeHalt(p);
  sqlite3SafetyOff(db);

  /* If the VDBE has be run even partially, then transfer the error code
  ** and error message from the VDBE into the main database structure.  But
  ** if the VDBE has just been set to run but has not actually executed any
  ** instructions yet, leave the main database error information unchanged.
  */
  if( p->pc>=0 ){
    if( p->zErrMsg ){
      sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, sqlite3FreeX);
      db->errCode = p->rc;
      p->zErrMsg = 0;
    }else if( p->rc ){
      sqlite3Error(db, p->rc, 0);
    }else{
      sqlite3Error(db, SQLITE_OK, 0);
    }
  }else if( p->rc && p->expired ){
    /* The expired flag was set on the VDBE before the first call
    ** to sqlite3_step(). For consistency (since sqlite3_step() was
    ** called), set the database error in this case as well.
    */
    sqlite3Error(db, p->rc, 0);
  }

  /* Reclaim all memory used by the VDBE
  */
  Cleanup(p);

  /* Save profiling information from this VDBE run.
  */
  assert( p->pTos<&p->aStack[p->pc<0?0:p->pc] || !p->aStack );
#ifdef VDBE_PROFILE
  {
    FILE *out = fopen("vdbe_profile.out", "a");
    if( out ){
      int i;
      fprintf(out, "---- ");
      for(i=0; i<p->nOp; i++){
        fprintf(out, "%02x", p->aOp[i].opcode);
      }
      fprintf(out, "\n");
      for(i=0; i<p->nOp; i++){
        fprintf(out, "%6d %10lld %8lld ",
           p->aOp[i].cnt,
           p->aOp[i].cycles,
           p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0
        );
        sqlite3VdbePrintOp(out, i, &p->aOp[i]);
      }
      fclose(out);
    }
  }
#endif
  p->magic = VDBE_MAGIC_INIT;
  p->aborted = 0;
  if( p->rc==SQLITE_SCHEMA ){
    sqlite3ResetInternalSchema(db, 0);
  }
  return p->rc & db->errMask;
}
 
/*
** Clean up and delete a VDBE after execution.  Return an integer which is
** the result code.  Write any error message text into *pzErrMsg.
*/
int sqlite3VdbeFinalize(Vdbe *p){
  int rc = SQLITE_OK;
  if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){
    rc = sqlite3VdbeReset(p);
    assert( (rc & p->db->errMask)==rc );
  }else if( p->magic!=VDBE_MAGIC_INIT ){
    return SQLITE_MISUSE;
  }
  sqlite3VdbeDelete(p);
  return rc;
}

/*
** Call the destructor for each auxdata entry in pVdbeFunc for which
** the corresponding bit in mask is clear.  Auxdata entries beyond 31
** are always destroyed.  To destroy all auxdata entries, call this
** routine with mask==0.
*/
void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){
  int i;
  for(i=0; i<pVdbeFunc->nAux; i++){
    struct AuxData *pAux = &pVdbeFunc->apAux[i];
    if( (i>31 || !(mask&(1<<i))) && pAux->pAux ){
      if( pAux->xDelete ){
        pAux->xDelete(pAux->pAux);
      }
      pAux->pAux = 0;
    }
  }
}

/*
** Delete an entire VDBE.
*/
void sqlite3VdbeDelete(Vdbe *p){
  int i;
  if( p==0 ) return;
  Cleanup(p);
  if( p->pPrev ){
    p->pPrev->pNext = p->pNext;
  }else{
    assert( p->db->pVdbe==p );
    p->db->pVdbe = p->pNext;
  }
  if( p->pNext ){
    p->pNext->pPrev = p->pPrev;
  }
  if( p->aOp ){
    for(i=0; i<p->nOp; i++){
      Op *pOp = &p->aOp[i];
      freeP3(pOp->p3type, pOp->p3);
    }
    sqliteFree(p->aOp);
  }
  releaseMemArray(p->aVar, p->nVar);
  sqliteFree(p->aLabel);
  sqliteFree(p->aStack);
  releaseMemArray(p->aColName, p->nResColumn*COLNAME_N);
  sqliteFree(p->aColName);
  p->magic = VDBE_MAGIC_DEAD;
  sqliteFree(p);
}

/*
** If a MoveTo operation is pending on the given cursor, then do that
** MoveTo now.  Return an error code.  If no MoveTo is pending, this
** routine does nothing and returns SQLITE_OK.
*/
int sqlite3VdbeCursorMoveto(Cursor *p){
  if( p->deferredMoveto ){
    int res, rc;
#ifdef SQLITE_TEST
    extern int sqlite3_search_count;
#endif
    assert( p->isTable );
    if( p->isTable ){
      rc = sqlite3BtreeMoveto(p->pCursor, 0, p->movetoTarget, &res);
    }else{
      rc = sqlite3BtreeMoveto(p->pCursor,(char*)&p->movetoTarget,
                              sizeof(i64),&res);
    }
    if( rc ) return rc;
    *p->pIncrKey = 0;
    p->lastRowid = keyToInt(p->movetoTarget);
    p->rowidIsValid = res==0;
    if( res<0 ){
      rc = sqlite3BtreeNext(p->pCursor, &res);
      if( rc ) return rc;
    }
#ifdef SQLITE_TEST
    sqlite3_search_count++;
#endif
    p->deferredMoveto = 0;
    p->cacheStatus = CACHE_STALE;
  }
  return SQLITE_OK;
}

/*
** The following functions:
**
** sqlite3VdbeSerialType()
** sqlite3VdbeSerialTypeLen()
** sqlite3VdbeSerialRead()
** sqlite3VdbeSerialLen()
** sqlite3VdbeSerialWrite()
**
** encapsulate the code that serializes values for storage in SQLite
** data and index records. Each serialized value consists of a
** 'serial-type' and a blob of data. The serial type is an 8-byte unsigned
** integer, stored as a varint.
**
** In an SQLite index record, the serial type is stored directly before
** the blob of data that it corresponds to. In a table record, all serial
** types are stored at the start of the record, and the blobs of data at
** the end. Hence these functions allow the caller to handle the
** serial-type and data blob seperately.
**
** The following table describes the various storage classes for data:
**
**   serial type        bytes of data      type
**   --------------     ---------------    ---------------
**      0                     0            NULL
**      1                     1            signed integer
**      2                     2            signed integer
**      3                     3            signed integer
**      4                     4            signed integer

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡一区二区三区高清视频| 欧美精品久久久久久久多人混战| 日韩一区二区三区视频在线| 亚洲成人免费电影| 欧美日本免费一区二区三区| 日本中文在线一区| ww久久中文字幕| 成人视屏免费看| 福利一区二区在线| 国产精品亲子乱子伦xxxx裸| 99麻豆久久久国产精品免费优播| **性色生活片久久毛片| 在线免费av一区| 精品写真视频在线观看| 国产欧美日韩精品a在线观看| 91丨九色丨蝌蚪富婆spa| 亚洲高清视频的网址| 26uuu色噜噜精品一区二区| 成人免费视频视频| 亚洲chinese男男1069| 亚洲精品在线观看网站| 91丝袜国产在线播放| 日韩影院免费视频| 中文字幕av一区二区三区高 | 久久精品99国产精品| 久久久午夜精品理论片中文字幕| 99久久综合99久久综合网站| 午夜不卡av在线| 国产精品你懂的在线| 欧美日韩第一区日日骚| 国产成人免费视频网站高清观看视频| 亚洲精品视频在线观看免费| 欧美v国产在线一区二区三区| 成人一区在线观看| 麻豆精品一二三| 亚洲精品亚洲人成人网在线播放| 精品久久久久久最新网址| 91年精品国产| 国产成人精品aa毛片| 日韩精品成人一区二区在线| 国产精品麻豆视频| 日韩欧美一二区| 欧美天堂一区二区三区| 成人黄色av网站在线| 久久精品二区亚洲w码| 一区二区三区加勒比av| 中文字幕精品三区| 日本美女一区二区三区视频| 国产精品麻豆99久久久久久| 日韩精品一区二区三区在线观看| 色婷婷国产精品综合在线观看| 国内一区二区在线| 日韩成人免费电影| 亚洲午夜精品一区二区三区他趣| 欧美国产日韩一二三区| 精品国产91久久久久久久妲己| 欧美亚洲国产一区在线观看网站| 成人午夜碰碰视频| 国产精品亚洲第一区在线暖暖韩国| 日韩精品一级中文字幕精品视频免费观看 | 欧美在线视频不卡| 成人av在线一区二区| 国产一区二区三区日韩| 蜜臀91精品一区二区三区| 日韩中文字幕亚洲一区二区va在线| 亚洲欧美成aⅴ人在线观看| 中文在线一区二区| 国产亚洲一区二区三区在线观看 | 韩国在线一区二区| 美女一区二区三区在线观看| 日韩不卡在线观看日韩不卡视频| 亚洲一区二区三区中文字幕在线| 亚洲精品日产精品乱码不卡| 亚洲男女一区二区三区| 亚洲欧美色图小说| 亚洲男人天堂一区| 亚洲一区国产视频| 偷拍日韩校园综合在线| 五月激情六月综合| 青青国产91久久久久久| 免费不卡在线观看| 久久成人18免费观看| 老汉av免费一区二区三区| 久久国产精品一区二区| 国模少妇一区二区三区| 粉嫩一区二区三区在线看| 不卡欧美aaaaa| 色婷婷综合五月| 欧美视频第二页| 欧美一区二区三区视频在线观看 | 在线观看国产一区二区| 欧美日韩国产高清一区二区三区| 91精品国产综合久久福利软件| 欧美一区二区三区的| 久久青草欧美一区二区三区| 国产婷婷色一区二区三区四区| 精品亚洲国产成人av制服丝袜| 国产成人综合视频| 91麻豆国产精品久久| 欧美年轻男男videosbes| 欧美v国产在线一区二区三区| 国产欧美视频一区二区三区| 亚洲天堂久久久久久久| 亚洲成人精品一区| 国产伦精一区二区三区| 99精品国产一区二区三区不卡| 91福利区一区二区三区| 日韩一本二本av| 日本一区二区三区在线不卡| 亚洲卡通动漫在线| 久久精品国产色蜜蜜麻豆| 大胆亚洲人体视频| 欧美日韩成人在线一区| 国产日韩综合av| 亚洲成a人片在线观看中文| 韩国av一区二区三区四区 | 欧美写真视频网站| 欧美大胆一级视频| 综合久久综合久久| 另类中文字幕网| 在线观看国产91| 欧美激情一区二区三区蜜桃视频| 亚洲一区av在线| 国产精品1区2区3区| 欧美日韩精品一区二区天天拍小说| 精品国产3级a| 亚洲123区在线观看| 国产精品亚洲综合一区在线观看| 欧美丝袜自拍制服另类| 国产精品视频线看| 精品一区二区日韩| 欧美在线free| 国产精品欧美久久久久一区二区| 无码av免费一区二区三区试看| 成人aa视频在线观看| 欧美mv日韩mv| 日韩精品国产精品| 欧美在线观看一区二区| 国产精品色婷婷久久58| 久久国产精品99久久久久久老狼| 欧美在线小视频| 亚洲欧洲精品一区二区三区不卡| 国内成人自拍视频| 欧美一区二区免费视频| 亚洲午夜羞羞片| 色又黄又爽网站www久久| 欧美高清一级片在线观看| 精品一区二区在线视频| 欧美一区二区三区免费视频| 亚洲午夜影视影院在线观看| 91污片在线观看| 中文字幕在线不卡视频| 高清国产一区二区| 精品久久一区二区三区| 欧美aaaaaa午夜精品| 7777精品伊人久久久大香线蕉的 | 乱中年女人伦av一区二区| 欧美日韩亚洲综合在线| 亚洲日本欧美天堂| 91免费精品国自产拍在线不卡| 国产农村妇女毛片精品久久麻豆 | 亚洲六月丁香色婷婷综合久久 | 91福利视频在线| 亚洲免费观看高清完整版在线| 成a人片国产精品| 欧美国产乱子伦 | 国产欧美日本一区二区三区| 国产原创一区二区| 久久精品免视看| 成人性色生活片| 日韩美女啊v在线免费观看| 99久久婷婷国产综合精品| 1024成人网色www| 色999日韩国产欧美一区二区| 亚洲自拍偷拍综合| 欧美丰满少妇xxxxx高潮对白| 午夜激情久久久| 欧美mv日韩mv国产网站app| 国产揄拍国内精品对白| 中文一区在线播放| 色妹子一区二区| 天堂va蜜桃一区二区三区漫画版| 91精品国产日韩91久久久久久| 日本va欧美va欧美va精品| 久久影院视频免费| 床上的激情91.| 亚洲午夜免费福利视频| 日韩欧美黄色影院| 成人免费观看男女羞羞视频| 亚洲欧美一区二区在线观看| 一本久道久久综合中文字幕| 一区二区三区鲁丝不卡| 91精品国产综合久久精品| 国产高清精品在线| 一区二区三区在线不卡| 日韩亚洲欧美高清| 成人va在线观看| 亚洲va欧美va人人爽| 国产日韩欧美精品在线| 精品视频1区2区|