Skip to content

Commit ab5df84

Browse files
committed
Fix issue #36
Clear pager cache after setting a new passphrase to force a reread of the database header.
1 parent 5013599 commit ab5df84

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codecext.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ mcReportCodecError(BtShared* pBt, int error)
8686
pBt->pPager->errCode = error;
8787
setGetterMethod(pBt->pPager);
8888
pBt->db->errCode = error;
89+
if (error == SQLITE_OK)
90+
{
91+
/* Clear cache to force reread of database after a new passphrase has been set */
92+
sqlite3PagerClearCache(pBt->pPager);
93+
}
8994
}
9095

9196
/*

0 commit comments

Comments
 (0)