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

Defer schema resets when the query planner is running.

Proposed fix for ticket [be436a7f4587ce517].

FossilOrigin-Name: a7bc7752ba0266684f5317e424a4ee9add4af002272082183519e708ab9ffc79
This commit is contained in:
drh
2017-08-17 02:26:35 +00:00
parent fe0cf7a18c
commit dc6b41ed47
6 changed files with 38 additions and 30 deletions

View File

@@ -686,7 +686,8 @@ static int sqlite3LockAndPrepare(
sqlite3_mutex_enter(db->mutex);
sqlite3BtreeEnterAll(db);
rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
if( rc==SQLITE_SCHEMA ){
if( rc==SQLITE_SCHEMA && db->nSchemaLock==0 ){
sqlite3ResetOneSchema(db, -1);
sqlite3_finalize(*ppStmt);
rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
}