diff options
author | drh <> | 2022-04-01 19:04:13 +0000 |
---|---|---|
committer | drh <> | 2022-04-01 19:04:13 +0000 |
commit | a24832b7b2ca8e10705448d04d4d0ca38e41a0bd (patch) | |
tree | 29594f57b5742269ba345dd4846e55ad14af9a97 /src | |
parent | cf6e3fd787fdcc3eb2e5edf2ea80146a195ac874 (diff) | |
download | sqlite-a24832b7b2ca8e10705448d04d4d0ca38e41a0bd.tar.gz sqlite-a24832b7b2ca8e10705448d04d4d0ca38e41a0bd.zip |
Omit the Vdbe.doingRerun field for a slight size reduction and performance gain.
FossilOrigin-Name: e93297a9d775688e6274c54ba75b19fc1fe8b29b73b9b5e7f94f3f2ca37f045f
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 2 | ||||
-rw-r--r-- | src/vdbeInt.h | 1 | ||||
-rw-r--r-- | src/vdbeapi.c | 9 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 5f8543e08..ffae6a395 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -8340,7 +8340,7 @@ case OP_Init: { /* jump */ #ifndef SQLITE_OMIT_TRACE if( (db->mTrace & (SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY))!=0 - && !p->doingRerun + && p->minWriteFileFormat!=254 /* tag-20220401a */ && (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 ){ #ifndef SQLITE_OMIT_DEPRECATED diff --git a/src/vdbeInt.h b/src/vdbeInt.h index 342b56ccb..792ead7b5 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -455,7 +455,6 @@ struct Vdbe { u8 errorAction; /* Recovery action to do in case of an error */ u8 minWriteFileFormat; /* Minimum file format for writable database files */ u8 prepFlags; /* SQLITE_PREPARE_* flags */ - u8 doingRerun; /* True if rerunning after an auto-reprepare */ u8 eVdbeState; /* On of the VDBE_*_STATE values */ bft expired:2; /* 1: recompile VM immediately 2: when convenient */ bft explain:2; /* True if EXPLAIN present on SQL command */ diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 40821c114..b07211177 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -797,7 +797,6 @@ int sqlite3_step(sqlite3_stmt *pStmt){ } db = v->db; sqlite3_mutex_enter(db->mutex); - v->doingRerun = 0; while( (rc = sqlite3Step(v))==SQLITE_SCHEMA && cnt++ < SQLITE_MAX_SCHEMA_RETRY ){ int savedPc = v->pc; @@ -823,7 +822,13 @@ int sqlite3_step(sqlite3_stmt *pStmt){ break; } sqlite3_reset(pStmt); - if( savedPc>=0 ) v->doingRerun = 1; + if( savedPc>=0 ){ + /* Setting minWriteFileFormat to 254 is a signal to the OP_Init and + ** OP_Trace opcodes to *not* perform SQLITE_TRACE_STMT because one + ** should output has already occurred due to SQLITE_SCHEMA. + ** tag-20220401a */ + v->minWriteFileFormat = 254; + } assert( v->expired==0 ); } sqlite3_mutex_leave(db->mutex); |