diff options
author | drh <drh@noemail.net> | 2014-12-05 15:31:33 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-12-05 15:31:33 +0000 |
commit | ebdb81dd455a3c3965b3159129d96fbcc49adb13 (patch) | |
tree | 483998ce556271914c592fd6fd7df48d0cbe74f7 /src | |
parent | 318dc0b4257b99e5d9298432b16b9243ddeacb74 (diff) | |
download | sqlite-ebdb81dd455a3c3965b3159129d96fbcc49adb13.tar.gz sqlite-ebdb81dd455a3c3965b3159129d96fbcc49adb13.zip |
The KeyInfo cache must be cleared before closing the btree, not after.
Revised fix for ticket [e4a18565a36884b00edf].
FossilOrigin-Name: 7ed3346e8c10dbf52fd44ab69900699d4f7ad3fd
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index 39c65baab..34093b249 100644 --- a/src/main.c +++ b/src/main.c @@ -1032,15 +1032,17 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){ for(j=0; j<db->nDb; j++){ struct Db *pDb = &db->aDb[j]; if( pDb->pBt ){ - sqlite3BtreeClose(pDb->pBt); - pDb->pBt = 0; - if( j!=1 && pDb->pSchema ){ + 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 ){ pDb->pSchema = 0; } } |