aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vdbe.c2
-rw-r--r--src/vdbeInt.h1
-rw-r--r--src/vdbeapi.c9
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);