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

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

?? vdbeaux.c

?? 新版輕量級嵌入式數據庫
?? C
?? 第 1 頁 / 共 4 頁
字號:
  /* The complex case - There is a multi-file write-transaction active.  ** This requires a master journal file to ensure the transaction is  ** committed atomicly.  */#ifndef SQLITE_OMIT_DISKIO  else{    int needSync = 0;    char *zMaster = 0;   /* File-name for the master journal */    char const *zMainFile = sqlite3BtreeGetFilename(db->aDb[0].pBt);    OsFile *master = 0;    /* Select a master journal file name */    do {      u32 random;      sqliteFree(zMaster);      sqlite3Randomness(sizeof(random), &random);      zMaster = sqlite3MPrintf("%s-mj%08X", zMainFile, random&0x7fffffff);      if( !zMaster ){        return SQLITE_NOMEM;      }    }while( sqlite3OsFileExists(zMaster) );    /* Open the master journal. */    rc = sqlite3OsOpenExclusive(zMaster, &master, 0);    if( rc!=SQLITE_OK ){      sqliteFree(zMaster);      return rc;    }     /* Write the name of each database file in the transaction into the new    ** master journal file. If an error occurs at this point close    ** and delete the master journal file. All the individual journal files    ** still have 'null' as the master journal pointer, so they will roll    ** back independently if a failure occurs.    */    for(i=0; i<db->nDb; i++){       Btree *pBt = db->aDb[i].pBt;      if( i==1 ) continue;   /* Ignore the TEMP database */      if( pBt && sqlite3BtreeIsInTrans(pBt) ){        char const *zFile = sqlite3BtreeGetJournalname(pBt);        if( zFile[0]==0 ) continue;  /* Ignore :memory: databases */        if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){          needSync = 1;        }        rc = sqlite3OsWrite(master, zFile, strlen(zFile)+1);        if( rc!=SQLITE_OK ){          sqlite3OsClose(&master);          sqlite3OsDelete(zMaster);          sqliteFree(zMaster);          return rc;        }      }    }    /* Sync the master journal file. Before doing this, open the directory    ** the master journal file is store in so that it gets synced too.    */    zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt);    rc = sqlite3OsOpenDirectory(master, zMainFile);    if( rc!=SQLITE_OK ||          (needSync && (rc=sqlite3OsSync(master,0))!=SQLITE_OK) ){      sqlite3OsClose(&master);      sqlite3OsDelete(zMaster);      sqliteFree(zMaster);      return rc;    }    /* Sync all the db files involved in the transaction. The same call    ** sets the master journal pointer in each individual journal. If    ** an error occurs here, do not delete the master journal file.    **    ** If the error occurs during the first call to sqlite3BtreeSync(),    ** then there is a chance that the master journal file will be    ** orphaned. But we cannot delete it, in case the master journal    ** file name was written into the journal file before the failure    ** occured.    */    for(i=0; i<db->nDb; i++){       Btree *pBt = db->aDb[i].pBt;      if( pBt && sqlite3BtreeIsInTrans(pBt) ){        rc = sqlite3BtreeSync(pBt, zMaster);        if( rc!=SQLITE_OK ){          sqlite3OsClose(&master);          sqliteFree(zMaster);          return rc;        }      }    }    sqlite3OsClose(&master);    /* Delete the master journal file. This commits the transaction. After    ** doing this the directory is synced again before any individual    ** transaction files are deleted.    */    rc = sqlite3OsDelete(zMaster);    assert( rc==SQLITE_OK );    sqliteFree(zMaster);    zMaster = 0;    rc = sqlite3OsSyncDirectory(zMainFile);    if( rc!=SQLITE_OK ){      /* This is not good. The master journal file has been deleted, but      ** the directory sync failed. There is no completely safe course of      ** action from here. The individual journals contain the name of the      ** master journal file, but there is no way of knowing if that      ** master journal exists now or if it will exist after the operating      ** system crash that may follow the fsync() failure.      */      return rc;    }    /* All files and directories have already been synced, so the following    ** calls to sqlite3BtreeCommit() are only closing files and deleting    ** journals. If something goes wrong while this is happening we don't    ** really care. The integrity of the transaction is already guaranteed,    ** but some stray 'cold' journals may be lying around. Returning an    ** error code won't help matters.    */    for(i=0; i<db->nDb; i++){       Btree *pBt = db->aDb[i].pBt;      if( pBt ){        sqlite3BtreeCommit(pBt);      }    }  }#endif  return rc;}/*** Find every active VM other than pVdbe and change its status to** aborted.  This happens when one VM causes a rollback due to an** ON CONFLICT ROLLBACK clause (for example).  The other VMs must be** aborted so that they do not have data rolled out from underneath** them leading to a segfault.*/void sqlite3AbortOtherActiveVdbes(sqlite3 *db, Vdbe *pExcept){  Vdbe *pOther;  for(pOther=db->pVdbe; pOther; pOther=pOther->pNext){    if( pOther==pExcept ) continue;    if( pOther->magic!=VDBE_MAGIC_RUN || pOther->pc<0 ) continue;    closeAllCursors(pOther);    pOther->aborted = 1;  }}/* ** This routine checks that the sqlite3.activeVdbeCnt count variable** matches the number of vdbe's in the list sqlite3.pVdbe that are** currently active. An assertion fails if the two counts do not match.** This is an internal self-check only - it is not an essential processing** step.**** This is a no-op if NDEBUG is defined.*/#ifndef NDEBUGstatic void checkActiveVdbeCnt(sqlite3 *db){  Vdbe *p;  int cnt = 0;  p = db->pVdbe;  while( p ){    if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){      cnt++;    }    p = p->pNext;  }  assert( cnt==db->activeVdbeCnt );}#else#define checkActiveVdbeCnt(x)#endif/*** This routine is called the when a VDBE tries to halt.  If the VDBE** has made changes and is in autocommit mode, then commit those** changes.  If a rollback is needed, then do the rollback.**** 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 );    return SQLITE_OK;  }  closeAllCursors(p);  checkActiveVdbeCnt(db);  /* No commit or rollback needed if the program never started */  if( p->pc>=0 ){    /* Check for one of the special errors - SQLITE_NOMEM or SQLITE_IOERR */    isSpecialError = ((p->rc==SQLITE_NOMEM || p->rc==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){  if( p->magic!=VDBE_MAGIC_RUN && p->magic!=VDBE_MAGIC_HALT ){    sqlite3Error(p->db, SQLITE_MISUSE, 0);    return SQLITE_MISUSE;  }  /* 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.  */  sqlite3VdbeHalt(p);  /* 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 ){      sqlite3* db = p->db;      sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, sqlite3FreeX);      db->errCode = p->rc;      p->zErrMsg = 0;    }else if( p->rc ){      sqlite3Error(p->db, p->rc, 0);    }else{      sqlite3Error(p->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(p->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(p->db, 0);  }  return p->rc;} /*** 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);  }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 ){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产乱子伦| 国产精品系列在线| 国产欧美一区二区精品秋霞影院| 国产精品私人影院| 美女爽到高潮91| 色婷婷国产精品久久包臀| 久久免费电影网| 日韩电影在线观看电影| 99麻豆久久久国产精品免费| 欧美精品一区二区三区蜜桃| 午夜视频在线观看一区二区 | 久久中文娱乐网| 中文字幕欧美一区| 国产一二精品视频| 日韩一区二区视频在线观看| 亚洲一区二区在线视频| av午夜精品一区二区三区| 国产丝袜在线精品| 国产一区在线精品| 欧美va亚洲va| 麻豆免费看一区二区三区| 91精品91久久久中77777| 国产精品亲子伦对白| 国产成人在线免费观看| 精品久久久久av影院| 老司机午夜精品| 3d动漫精品啪啪一区二区竹菊| 亚洲图片欧美视频| 色婷婷亚洲精品| 日韩一区日韩二区| 91丨porny丨国产入口| 国产精品国模大尺度视频| 国产精品77777| 国产日韩欧美亚洲| 国产精品白丝av| 国产精品色婷婷| 99久久国产综合色|国产精品| 中文字幕一区二区视频| 99亚偷拍自图区亚洲| 曰韩精品一区二区| 欧美视频一区二| 日韩高清一级片| 日韩欧美一二三| 国产精品综合视频| 亚洲丝袜制服诱惑| 欧美日韩一区二区三区视频| 免费在线观看一区| 久久夜色精品一区| av一二三不卡影片| 五月天丁香久久| 精品久久久久香蕉网| 国产91富婆露脸刺激对白| 亚洲色图视频网| 欧美日韩精品一区二区三区蜜桃| 五月天婷婷综合| 久久久久久99精品| 色综合久久中文字幕| 日韩—二三区免费观看av| 久久影院午夜片一区| 91麻豆自制传媒国产之光| 午夜久久久久久电影| 2023国产精品视频| 色狠狠桃花综合| 麻豆精品精品国产自在97香蕉| 中文字幕欧美日韩一区| 欧美日韩国产天堂| 国产精品一区二区不卡| 亚洲综合色在线| 欧美xxxx在线观看| 日本高清不卡一区| 国产一区欧美二区| 亚洲国产成人porn| 国产日韩av一区| 精品视频资源站| 国产麻豆一精品一av一免费| 一区二区三区产品免费精品久久75| 欧美videofree性高清杂交| 91在线视频免费91| 激情都市一区二区| 亚洲小少妇裸体bbw| 国产精品女主播av| 欧美va在线播放| 欧美午夜免费电影| 国产99精品国产| 日本伊人精品一区二区三区观看方式| 国产精品美女一区二区三区| 日韩三级免费观看| 欧美在线观看你懂的| 国产成人精品影院| 日本欧美肥老太交大片| 亚洲主播在线播放| 18涩涩午夜精品.www| 久久亚洲免费视频| 日韩欧美在线影院| 在线观看视频欧美| 99精品欧美一区二区三区小说 | 中文字幕高清一区| 久久久亚洲综合| 日韩限制级电影在线观看| 在线观看不卡一区| 欧美亚洲日本一区| 色悠悠久久综合| 99精品久久只有精品| 处破女av一区二区| 国产99久久久国产精品免费看| 精彩视频一区二区| 激情深爱一区二区| 久久电影网站中文字幕| 日韩高清不卡一区| 日韩主播视频在线| 日韩激情视频在线观看| 五月婷婷综合激情| 日韩电影在线观看网站| 日本不卡1234视频| 免费看日韩a级影片| 奇米一区二区三区| 久久99国产精品尤物| 国产在线精品一区二区三区不卡| 久久精品国产精品亚洲综合| 精品一区二区三区久久| 国产一区二区三区| 国产91精品免费| 99久久久久久99| 日本道精品一区二区三区| 日本高清不卡视频| 4438x亚洲最大成人网| 精品日韩在线一区| 国产精品亲子伦对白| 一区二区三区欧美日韩| 亚洲sss视频在线视频| 丝袜国产日韩另类美女| 精品一区二区av| 丰满少妇在线播放bd日韩电影| 成人动漫一区二区| 日本黄色一区二区| 欧美一区二区三区视频在线| 久久综合精品国产一区二区三区 | 国产一区二区精品在线观看| 国产精品一区在线观看乱码| 成人免费观看男女羞羞视频| 色香蕉久久蜜桃| 91精品国产福利| 中文字幕 久热精品 视频在线| 亚洲精品亚洲人成人网在线播放| 亚洲成av人影院| 国产成人av电影免费在线观看| 一本大道久久a久久精二百| 制服丝袜在线91| 亚洲国产精品精华液2区45| 亚洲永久免费av| 韩国v欧美v亚洲v日本v| 91麻豆高清视频| 欧美大片国产精品| 一区二区在线观看视频| 久久精工是国产品牌吗| 色哟哟国产精品| 久久久久久久网| 性做久久久久久久免费看| 国产成人免费视频网站高清观看视频 | 色综合视频一区二区三区高清| 91精品欧美久久久久久动漫| 国产精品视频yy9299一区| 蜜臀av国产精品久久久久| 99riav一区二区三区| 欧美电视剧在线观看完整版| 亚洲精品视频自拍| 国产精品综合久久| 欧美一区永久视频免费观看| 专区另类欧美日韩| 久久机这里只有精品| 欧美性videosxxxxx| 国产精品污网站| 久久97超碰国产精品超碰| 欧美视频自拍偷拍| 日韩伦理av电影| 国产99精品国产| 久久久精品国产99久久精品芒果| 亚洲成av人片在线观看无码| 色婷婷一区二区三区四区| 亚洲国产精品国自产拍av| 激情成人综合网| 日韩一级免费观看| 五月激情综合网| 欧美日韩国产另类不卡| 亚洲激情男女视频| av在线免费不卡| 国产精品的网站| 成人精品国产一区二区4080| 精品国产伦理网| 麻豆一区二区三| 日韩欧美二区三区| 另类小说色综合网站| 欧美一区二区三区精品| 三级久久三级久久| 在线不卡一区二区| 日本sm残虐另类| 日韩欧美一区二区免费| 久久超碰97人人做人人爱| 久久综合色综合88| 国产不卡一区视频|