/ Check-in [06bc8917]
Login

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

Overview
Comment:Change the sqlite3_backup_finish() interface so that calling it with a NULL pointer is a harmless no-op. One other change to backup.c to facilitate full coverage testing. (CVS 6638)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 06bc89177b3af20751d9567a68551d2d31c3fe8b
User & Date: drh 2009-05-14 19:26:51
Context
2009-05-14
22:37
Documentation enhancements for sqlite3_update_hook(), sqlite3_commit_hook(), and the various incremental blob I/O routines. No changes to code. (CVS 6639) check-in: e8ca932d user: drh tags: trunk
19:26
Change the sqlite3_backup_finish() interface so that calling it with a NULL pointer is a harmless no-op. One other change to backup.c to facilitate full coverage testing. (CVS 6638) check-in: 06bc8917 user: drh tags: trunk
03:21
Documentation updates to better explain the SQLITE_OPEN_EXCLUSIVE flag. Ticket #3855. (CVS 6637) check-in: 6bd44f36 user: shane tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/backup.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains the implementation of the sqlite3_backup_XXX() 
    13     13   ** API functions and the related features.
    14     14   **
    15         -** $Id: backup.c,v 1.14 2009/05/13 07:52:06 danielk1977 Exp $
           15  +** $Id: backup.c,v 1.15 2009/05/14 19:26:51 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include "btreeInt.h"
    19     19   
    20     20   /* Macro to find the minimum of two numeric values.
    21     21   */
    22     22   #ifndef MIN
................................................................................
   180    180   
   181    181   /*
   182    182   ** Argument rc is an SQLite error code. Return true if this error is 
   183    183   ** considered fatal if encountered during a backup operation. All errors
   184    184   ** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
   185    185   */
   186    186   static int isFatalError(int rc){
   187         -  return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED);
          187  +  return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && ALWAYS(rc!=SQLITE_LOCKED));
   188    188   }
   189    189   
   190    190   /*
   191    191   ** Parameter zSrcData points to a buffer containing the data for 
   192    192   ** page iSrcPg from the source database. Copy this data into the 
   193    193   ** destination database.
   194    194   */
................................................................................
   465    465   */
   466    466   int sqlite3_backup_finish(sqlite3_backup *p){
   467    467     sqlite3_backup **pp;                 /* Ptr to head of pagers backup list */
   468    468     sqlite3_mutex *mutex;                /* Mutex to protect source database */
   469    469     int rc;                              /* Value to return */
   470    470   
   471    471     /* Enter the mutexes */
          472  +  if( p==0 ) return SQLITE_OK;
   472    473     sqlite3_mutex_enter(p->pSrcDb->mutex);
   473    474     sqlite3BtreeEnter(p->pSrc);
   474    475     mutex = p->pSrcDb->mutex;
   475    476     if( p->pDestDb ){
   476    477       sqlite3_mutex_enter(p->pDestDb->mutex);
   477    478     }
   478    479