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