/ Check-in [5523ecd3]
Login

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

Overview
Comment:Do not allow a backup to change the page size if a codec is in use.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5523ecd32295c188e3bf5dbd57d92d2879461e32
User & Date: drh 2010-08-20 15:32:21
Context
2010-08-21
15:09
Fix the ptrmapPageno() routine so that it works correctly for an input of 1. check-in: 699a9bf2 user: drh tags: trunk
2010-08-20
15:32
Do not allow a backup to change the page size if a codec is in use. check-in: 5523ecd3 user: drh tags: trunk
12:43
Fix typo in backcompat.test. check-in: 6a0cbb27 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/backup.c.

   216    216   
   217    217     /* Catch the case where the destination is an in-memory database and the
   218    218     ** page sizes of the source and destination differ. 
   219    219     */
   220    220     if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){
   221    221       rc = SQLITE_READONLY;
   222    222     }
          223  +
          224  +#ifdef SQLITE_HAS_CODEC
          225  +  /* Backup is not possible if the page size of the destination is changing
          226  +  ** a a codec is in use.
          227  +  */
          228  +  if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){
          229  +    rc = SQLITE_READONLY;
          230  +  }
          231  +#endif
   223    232   
   224    233     /* This loop runs once for each destination page spanned by the source 
   225    234     ** page. For each iteration, variable iOff is set to the byte offset
   226    235     ** of the destination page.
   227    236     */
   228    237     for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff<iEnd; iOff+=nDestPgsz){
   229    238       DbPage *pDestPg = 0;