1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Avoid repeating calls to the sqlite3_trace() callback when the same statement

is evaluted multiple times by sqlite3_step() due to an SQLITE_SCHEMA
reprepare.

FossilOrigin-Name: 39f763bfc04174ee0fe2cdf6a92b7c12f726bd1b
This commit is contained in:
drh
2012-09-04 21:34:26 +00:00
parent 8a7c142887
commit 37f58e9902
5 changed files with 29 additions and 21 deletions

View File

@@ -478,10 +478,12 @@ 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
&& (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK ){
sqlite3_reset(pStmt);
v->doingRerun = 1;
assert( v->expired==0 );
}
if( rc2!=SQLITE_OK && ALWAYS(v->isPrepareV2) && ALWAYS(db->pErr) ){