]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Refactor the Vdbe.noIO field as Vdbe.bIsReader. The meaning is inverted.
authordrh <drh@noemail.net>
Fri, 28 Jun 2013 01:24:57 +0000 (01:24 +0000)
committerdrh <drh@noemail.net>
Fri, 28 Jun 2013 01:24:57 +0000 (01:24 +0000)
FossilOrigin-Name: 59f98c5c241e5a61cd5b6d0e69b55a6b44c5cafc

manifest
manifest.uuid
src/btree.c
src/sqliteInt.h
src/vdbe.c
src/vdbeInt.h
src/vdbeapi.c
src/vdbeaux.c

index 140fcde011ae1994b1cb2bb5faa32c7d5b7c7051..0dc08ba2f34323619d3a4ad1d728a76d9f232b26 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Refactor\snames\sof\sfields\sin\sthe\ssqlite3\sobject:\s\s"activeVdbeCnt"\sbecomes\n"nVdbeActive".\s\sRelated\sfields\sbecomes\s"nVdbeRead",\s"nVdbeWrite",\sand\n"nVdbeExec".
-D 2013-06-27T23:54:02.351
+C Refactor\sthe\sVdbe.noIO\sfield\sas\sVdbe.bIsReader.\sThe\smeaning\sis\sinverted.
+D 2013-06-28T01:24:57.868
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -163,7 +163,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c 43b348822db3e4cef48b2ae5a445fbeb6c73a165
 F src/bitvec.c 19a4ba637bd85f8f63fc8c9bae5ade9fb05ec1cb
 F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
-F src/btree.c c29ca37122c34cd2114ac692c71b32c595a563ba
+F src/btree.c 4fc3690a4a8f802e167f40261cbff8271f820599
 F src/btree.h 6fa8a3ff2483d0bb64a9f0105a8cedeac9e00cca
 F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2
 F src/build.c 42239cfd95533e4aacf4d58b4724c8f858de5ced
@@ -221,7 +221,7 @@ F src/shell.c c0f38cee126d1ea82275195933359e91d90196a0
 F src/sqlite.h.in 9e8d57aa4d2fdc181dc25e9aa295f5ecec7e184a
 F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0
 F src/sqlite3ext.h d936f797812c28b81b26ed18345baf8db28a21a5
-F src/sqliteInt.h d73fc173b91e00af4ed9f3b2a78342bde20432c1
+F src/sqliteInt.h 15f1a7e51486eee145597f6543f3875974ed5a97
 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
 F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9
 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
@@ -277,11 +277,11 @@ F src/update.c 8e76c3d03e4b7b21cb250bd2df0c05e12993e577
 F src/utf.c 8d819e2e5104a430fc2005f018db14347c95a38f
 F src/util.c f566b5138099a2df8533b190d0dcc74b7dfbe0c9
 F src/vacuum.c d9c5759f4c5a438bb43c2086f72c5d2edabc36c8
-F src/vdbe.c 462058f28bd83764d7161fdc38a1ab4a36ecf436
+F src/vdbe.c 9816247ea2066c427c199d5525d0bfa6916abb68
 F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d
-F src/vdbeInt.h 9735fdf28b8d250e001e5b406f7011a40888c739
-F src/vdbeapi.c 649df0c9ea0e7564b1f28770992f40b68b780c3e
-F src/vdbeaux.c 70d850ccb339024987b9e6fc348a5792df37c9b4
+F src/vdbeInt.h aa185c6df4f2b5ec9896cdb5f96789af1ef69f76
+F src/vdbeapi.c e3ad4cddb713a387527f982e79d9e001a0dbffa5
+F src/vdbeaux.c 00674a9bbfbc235340dc5c8c305dfeecc5ef614f
 F src/vdbeblob.c 5dc79627775bd9a9b494dd956e26297946417d69
 F src/vdbemem.c 833005f1cbbf447289f1973dba2a0c2228c7b8ab
 F src/vdbesort.c 3937e06b2a0e354500e17dc206ef4c35770a5017
@@ -1098,7 +1098,7 @@ F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
 F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P fd4ece18c9be7019e60da3cb0a200c5b1903fed4
-R 17f76bda97975e919a128454b72c14b9
+P 14f796963474350e7aee8d3757acd3315fe78e4f
+R fe26d24ee74e8945b518975ca34639ae
 U drh
-Z 5a9942fd8b4b104ca1abff550cfcbf5d
+Z 103752d0a887c9636df5a0b29ea996df
index 97fb09d41c48b1471d818015cb13756c98d6fd0b..1db43c1d627a4f59a2e32c90a88955769b9c9dd3 100644 (file)
@@ -1 +1 @@
-14f796963474350e7aee8d3757acd3315fe78e4f
\ No newline at end of file
+59f98c5c241e5a61cd5b6d0e69b55a6b44c5cafc
\ No newline at end of file
index db8a9ddb189a6381e2e7b46e25966a9e37026cc0..32e069655bb7cacc8dd4325fc3111d299601a90f 100644 (file)
@@ -3273,12 +3273,13 @@ int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
 */
 static void btreeEndTransaction(Btree *p){
   BtShared *pBt = p->pBt;
+  sqlite3 *db = p->db;
   assert( sqlite3BtreeHoldsMutex(p) );
 
 #ifndef SQLITE_OMIT_AUTOVACUUM
   pBt->bDoTruncate = 0;
 #endif
-  if( p->inTrans>TRANS_NONE && p->db->nVdbeActive>1 ){
+  if( p->inTrans>TRANS_NONE && db->nVdbeActive>1 ){
     /* If there are other active statements that belong to this database
     ** handle, downgrade to a read-only transaction. The other statements
     ** may still be reading from the database.  */
index 2c19b84c90c10eb29424609838a0518e06242278..5193fac1a51d46759f6569bc1a6694406124dd3c 100644 (file)
@@ -897,10 +897,10 @@ struct sqlite3 {
     u8 busy;                    /* TRUE if currently initializing */
     u8 orphanTrigger;           /* Last statement is orphaned TEMP trigger */
   } init;
-  int nVdbeActive;            /* Number of VDBEs currently executing */
-  int nVdbeRead;              /* Number of active VDBEs that read or write */
-  int nVdbeWrite;             /* Number of active VDBEs that read and write */
-  int nVdbeExec;              /* Number of nested calls to VdbeExec() */
+  int nVdbeActive;              /* Number of VDBEs currently running */
+  int nVdbeRead;                /* Number of active VDBEs that read or write */
+  int nVdbeWrite;               /* Number of active VDBEs that read and write */
+  int nVdbeExec;                /* Number of nested calls to VdbeExec() */
   int nExtension;               /* Number of loaded extensions */
   void **aExtension;            /* Array of shared library handles */
   void (*xTrace)(void*,const char*);        /* Trace function */
index 8906de2d5b166924f1c41d2afab0557b95862486..2be8356d559c4225f48b050791475e021e2e63f7 100644 (file)
@@ -579,7 +579,7 @@ int sqlite3VdbeExec(
     goto no_mem;
   }
   assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY );
-  assert( p->noIO==0 || p->readOnly!=0 );
+  assert( p->bIsReader || p->readOnly!=0 );
   p->rc = SQLITE_OK;
   assert( p->explain==0 );
   p->pResultSet = 0;
@@ -2935,7 +2935,7 @@ case OP_AutoCommit: {
 case OP_Transaction: {
   Btree *pBt;
 
-  assert( p->noIO==0 );
+  assert( p->bIsReader );
   assert( p->readOnly==0 || pOp->p2==0 );
   assert( pOp->p1>=0 && pOp->p1<db->nDb );
   assert( (p->btreeMask & (((yDbMask)1)<<pOp->p1))!=0 );
@@ -2993,7 +2993,7 @@ case OP_ReadCookie: {               /* out2-prerelease */
   int iDb;
   int iCookie;
 
-  assert( p->noIO==0 );
+  assert( p->bIsReader );
   iDb = pOp->p1;
   iCookie = pOp->p3;
   assert( pOp->p3<SQLITE_N_BTREE_META );
@@ -3072,7 +3072,7 @@ case OP_VerifyCookie: {
   assert( pOp->p1>=0 && pOp->p1<db->nDb );
   assert( (p->btreeMask & (((yDbMask)1)<<pOp->p1))!=0 );
   assert( sqlite3SchemaMutexHeld(db, pOp->p1, 0) );
-  assert( p->noIO==0 );
+  assert( p->bIsReader );
   pBt = db->aDb[pOp->p1].pBt;
   if( pBt ){
     sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&iMeta);
@@ -3168,7 +3168,7 @@ case OP_OpenWrite: {
 
   assert( (pOp->p5&(OPFLAG_P2ISREG|OPFLAG_BULKCSR))==pOp->p5 );
   assert( pOp->opcode==OP_OpenWrite || pOp->p5==0 );
-  assert( p->noIO==0 );
+  assert( p->bIsReader );
   assert( pOp->opcode==OP_OpenRead || p->readOnly==0 );
 
   if( p->expired ){
@@ -4992,7 +4992,7 @@ case OP_IntegrityCk: {
   char *z;        /* Text of the error report */
   Mem *pnErr;     /* Register keeping track of errors remaining */
 
-  assert( p->noIO==0 );
+  assert( p->bIsReader );
   nRoot = pOp->p2;
   assert( nRoot>0 );
   aRoot = sqlite3DbMallocRaw(db, sizeof(int)*(nRoot+1) );
@@ -5768,7 +5768,7 @@ case OP_VOpen: {
   sqlite3_vtab *pVtab;
   sqlite3_module *pModule;
 
-  assert( p->noIO==0 );
+  assert( p->bIsReader );
   pCur = 0;
   pVtabCursor = 0;
   pVtab = pOp->p4.pVtab->pVtab;
index 7b66742063e502cdb3b3ad1fdb163a62a38bdf25..289f83d45dda9670bb7d1c9c8424a5f585e5b460 100644 (file)
@@ -338,7 +338,7 @@ struct Vdbe {
   bft runOnlyOnce:1;      /* Automatically expire on reset */
   bft usesStmtJournal:1;  /* True if uses a statement journal */
   bft readOnly:1;         /* True for statements that do not write */
-  bft noIO:1;             /* True for SELECTs with no FROM clause */
+  bft bIsReader:1;        /* True for statements that read */
   bft isPrepareV2:1;      /* True if prepared with prepare_v2() */
   bft doingRerun:1;       /* True if rerunning after an auto-reprepare */
   int nChange;            /* Number of db changes made since last reset */
index 9c64584ce05d084473d90b9ae196726dfbb84d4b..efa9e96962279799f6a9b5ded72e02ec4d65c798 100644 (file)
@@ -396,7 +396,7 @@ static int sqlite3Step(Vdbe *p){
 
     db->nVdbeActive++;
     if( p->readOnly==0 ) db->nVdbeWrite++;
-    if( p->noIO==0 ) db->nVdbeRead++;
+    if( p->bIsReader ) db->nVdbeRead++;
     p->pc = 0;
   }
 #ifndef SQLITE_OMIT_EXPLAIN
index 665913b2a84c1e22b2193fa0fa17f72bef01f7d3..b10f35807f743e4d53cd9ff5d033ba32faf0a4f8 100644 (file)
@@ -403,7 +403,7 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
   Op *pOp;
   int *aLabel = p->aLabel;
   p->readOnly = 1;
-  p->noIO = 1;
+  p->bIsReader = 0;
   for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){
     u8 opcode = pOp->opcode;
 
@@ -412,7 +412,7 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
       if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5;
     }else if( opcode==OP_Transaction ){
       if( pOp->p2!=0 ) p->readOnly = 0;
-      p->noIO = 0;
+      p->bIsReader = 1;
     }else if( opcode==OP_Vacuum
            || opcode==OP_JournalMode
 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -420,7 +420,7 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
 #endif
     ){
       p->readOnly = 0;
-      p->noIO = 0;
+      p->bIsReader = 1;
 #ifndef SQLITE_OMIT_VIRTUALTABLE
     }else if( opcode==OP_VUpdate ){
       if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2;
@@ -1991,7 +1991,7 @@ static void checkActiveVdbeCnt(sqlite3 *db){
     if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){
       cnt++;
       if( p->readOnly==0 ) nWrite++;
-      if( p->noIO==0 ) nRead++;
+      if( p->bIsReader ) nRead++;
     }
     p = p->pNext;
   }
@@ -2270,7 +2270,7 @@ int sqlite3VdbeHalt(Vdbe *p){
   if( p->pc>=0 ){
     db->nVdbeActive--;
     if( !p->readOnly ) db->nVdbeWrite--;
-    if( p->noIO==0 ) db->nVdbeRead--;
+    if( p->bIsReader ) db->nVdbeRead--;
     assert( db->nVdbeActive>=db->nVdbeRead );
     assert( db->nVdbeRead>=db->nVdbeWrite );
     assert( db->nVdbeWrite>=0 );