aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-12-08 18:08:45 +0000
committerdrh <drh@noemail.net>2014-12-08 18:08:45 +0000
commitb88c7b550c3fd50b6f9c8837735696f7f66a944b (patch)
tree8e3c1f6c4fdcb09831a2a2c4aa0aa68cf846b5da /src
parent8f1eb8a1cb3dd5c61b28470ec66e908193dc03a4 (diff)
downloadsqlite-b88c7b550c3fd50b6f9c8837735696f7f66a944b.tar.gz
sqlite-b88c7b550c3fd50b6f9c8837735696f7f66a944b.zip
Add a missing mutex around calls to clear the KeyInfo cache when closing
a database connection. FossilOrigin-Name: 7047ce32a234484b8ba15311e6560aa74ff692c9
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 34093b249..23239bc94 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1034,11 +1034,13 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
if( pDb->pBt ){
if( pDb->pSchema ){
/* Must clear the KeyInfo cache. See ticket [e4a18565a36884b00edf] */
+ sqlite3BtreeEnter(pDb->pBt);
for(i=sqliteHashFirst(&pDb->pSchema->idxHash); i; i=sqliteHashNext(i)){
Index *pIdx = sqliteHashData(i);
sqlite3KeyInfoUnref(pIdx->pKeyInfo);
pIdx->pKeyInfo = 0;
}
+ sqlite3BtreeLeave(pDb->pBt);
}
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;