/ Check-in [0bf0fd24]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Always reset the pager before changing the codec.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0bf0fd242b93c3bd308ab46db1be9edef141b89db07a0f5a4ed8b23c963da0d5
User & Date: drh 2018-10-11 16:38:56
References
2018-11-28
11:09
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. check-in: 5c040fdb user: drh tags: trunk
Context
2018-10-11
16:53
Fix harmless compiler warnings in the CLI. check-in: 1916d291 user: drh tags: trunk
16:38
Always reset the pager before changing the codec. check-in: 0bf0fd24 user: drh tags: trunk
13:51
On the first connection to a WAL-mode database that was not cleanly shut down and contains a left-over -shm file, truncate the -shm file to 3 bytes instead of to 0 bytes. Avoiding a truncation to 0 means that system monitoring tools can better detect if a process illegitimately tries to truncate a -shm file. Such a rogue process might think it is being helpful by cleaning up old files, but there is a race condition that can cause damage to the database. check-in: 90cf32cd user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  7017   7017   void sqlite3PagerSetCodec(
  7018   7018     Pager *pPager,
  7019   7019     void *(*xCodec)(void*,void*,Pgno,int),
  7020   7020     void (*xCodecSizeChng)(void*,int,int),
  7021   7021     void (*xCodecFree)(void*),
  7022   7022     void *pCodec
  7023   7023   ){
         7024  +  pager_reset(pPager);
  7024   7025     if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec);
  7025   7026     pPager->xCodec = pPager->memDb ? 0 : xCodec;
  7026   7027     pPager->xCodecSizeChng = xCodecSizeChng;
  7027   7028     pPager->xCodecFree = xCodecFree;
  7028   7029     pPager->pCodec = pCodec;
  7029   7030     setGetterMethod(pPager);
  7030   7031     pagerReportSize(pPager);