1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Follow-up to [0bf0fd242b93c3bd30]: only reset the pager when adding a

new codec, not when overwriting an existing codec.  Also, improve a
comment in the pcache1 subsystem.

FossilOrigin-Name: 5c040fdb013d178e5dffa300621eab91b92beb085ffb9ef2ba08f6bf1dd4013e
This commit is contained in:
drh
2018-11-28 11:09:09 +00:00
parent 49f6a0d82a
commit 26505e5f51
4 changed files with 16 additions and 12 deletions

View File

@@ -7032,8 +7032,11 @@ void sqlite3PagerSetCodec(
void (*xCodecFree)(void*),
void *pCodec
){
pager_reset(pPager);
if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec);
if( pPager->xCodecFree ){
pPager->xCodecFree(pPager->pCodec);
}else{
pager_reset(pPager);
}
pPager->xCodec = pPager->memDb ? 0 : xCodec;
pPager->xCodecSizeChng = xCodecSizeChng;
pPager->xCodecFree = xCodecFree;