diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 47f96ac64..8f850fb65 100644 --- a/src/main.c +++ b/src/main.c @@ -1032,6 +1032,14 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){ for(j=0; j<db->nDb; j++){ struct Db *pDb = &db->aDb[j]; if( pDb->pBt ){ + if( pDb->pSchema ){ + /* Must clear the KeyInfo cache. See ticket [e4a18565a36884b00edf] */ + for(i=sqliteHashFirst(&pDb->pSchema->idxHash); i; i=sqliteHashNext(i)){ + Index *pIdx = sqliteHashData(i); + sqlite3KeyInfoUnref(pIdx->pKeyInfo); + pIdx->pKeyInfo = 0; + } + } sqlite3BtreeClose(pDb->pBt); pDb->pBt = 0; if( j!=1 ){ |