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

When closing a (shared-cache) database connection, be sure to clear out all

KeyInfo objects cached on Index objects.
Proposed fix for ticket [e4a18565a36884b00edf].

FossilOrigin-Name: 651ed97de13234be60a1138a98b06d308449a791
This commit is contained in:
drh
2014-12-05 05:38:02 +00:00
parent 2c3abeb8c3
commit ffc8f3e201
3 changed files with 17 additions and 8 deletions

View File

@@ -1034,7 +1034,13 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
if( pDb->pBt ){
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;
if( j!=1 ){
if( j!=1 && 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;
}
pDb->pSchema = 0;
}
}