SQLite

Check-in [2c443d47ec]
Login

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

Overview
Comment:Reorder some of the branches in backup.c in order to make the code easier to test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2c443d47ecee7b43a89f0a4bf299c46c66e3f80d
User & Date: drh 2011-08-25 20:18:47.446
Context
2011-08-26
00:34
Create a new pager type, PAGER_SORTER, for use in the external merge sort. Such pagers are always held in memory but do report when they are under memory pressure by calling pagerStress. (check-in: c71d73201d user: drh tags: trunk)
2011-08-25
20:18
Reorder some of the branches in backup.c in order to make the code easier to test. (check-in: 2c443d47ec user: drh tags: trunk)
19:28
Replace an assert() that a condition may not occur in backup.c with code to handle that condition, which can occur. (check-in: 472c74b345 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/backup.c.
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
    }
  
    /* Update the schema version field in the destination database. This
    ** is to make sure that the schema-version really does change in
    ** the case where the source and destination databases have the
    ** same schema version.
    */
    if( rc==SQLITE_DONE 
     && (rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1))==SQLITE_OK
    ){
      if( p->pDestDb ){
        sqlite3ResetInternalSchema(p->pDestDb, -1);
      }
      if( destMode==PAGER_JOURNALMODE_WAL ){
        rc = sqlite3BtreeSetVersion(p->pDest, 2);
      }

      if( rc==SQLITE_OK ){
        int nDestTruncate;
        /* Set nDestTruncate to the final number of pages in the destination
        ** database. The complication here is that the destination page
        ** size may be different to the source page size. 
        **
        ** If the source page size is smaller than the destination page size, 







|
|
|
|
|
|
|
|
|
|







406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
    }
  
    /* Update the schema version field in the destination database. This
    ** is to make sure that the schema-version really does change in
    ** the case where the source and destination databases have the
    ** same schema version.
    */
    if( rc==SQLITE_DONE ){
      rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1);
      if( rc==SQLITE_OK ){
        if( p->pDestDb ){
          sqlite3ResetInternalSchema(p->pDestDb, -1);
        }
        if( destMode==PAGER_JOURNALMODE_WAL ){
          rc = sqlite3BtreeSetVersion(p->pDest, 2);
        }
      }
      if( rc==SQLITE_OK ){
        int nDestTruncate;
        /* Set nDestTruncate to the final number of pages in the destination
        ** database. The complication here is that the destination page
        ** size may be different to the source page size. 
        **
        ** If the source page size is smaller than the destination page size,