/ Check-in [f2700040]
Login

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

Overview
Comment:When a "full", "restart" or "truncate" checkpoint is attempted, return SQLITE_BUSY if a reader prevents the checkpointer from copying any frames at all into the database file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | ota-update
Files: files | file ages | folders
SHA1: f270004016ef20f1963e0f1ad32e76bcbaeb6798
User & Date: dan 2015-01-28 15:30:03
Context
2015-01-28
20:37
Add missing VdbeCoverage() macros to the sqlite3_index_writer() implementation. check-in: 6f8cda26 user: drh tags: ota-update
15:30
When a "full", "restart" or "truncate" checkpoint is attempted, return SQLITE_BUSY if a reader prevents the checkpointer from copying any frames at all into the database file. check-in: f2700040 user: dan tags: ota-update
12:27
Correctly detect errors returned by walCheckpointStart() due to OOM. check-in: 8e878c20 user: drh tags: ota-update
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/wal.c.

  1820   1820   #endif
  1821   1821       }
  1822   1822   
  1823   1823       /* Release the reader lock held while backfilling */
  1824   1824       walUnlockExclusive(pWal, WAL_READ_LOCK(0), 1);
  1825   1825       walIteratorFree(p->pIter);
  1826   1826       p->pIter = 0;
         1827  +  }else if( p->rc==SQLITE_DONE ){
         1828  +    p->rc = SQLITE_OK;
  1827   1829     }
  1828   1830   
  1829   1831     return p->rc;
  1830   1832   }
  1831   1833   
  1832   1834   /*
  1833   1835   ** The following is guaranteed when this function is called:
................................................................................
  1905   1907     WalCkpt sC;
  1906   1908   
  1907   1909     /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked
  1908   1910     ** in the SQLITE_CHECKPOINT_PASSIVE mode. */
  1909   1911     assert( eMode!=SQLITE_CHECKPOINT_PASSIVE || xBusy==0 );
  1910   1912   
  1911   1913     rc = walCheckpointStart(pWal, zBuf, nBuf, xBusy, pBusyArg, sync_flags, &sC);
  1912         -  if( sC.pIter==0 || rc!=SQLITE_OK ) goto walcheckpoint_out;
         1914  +  if( rc!=SQLITE_OK ) goto walcheckpoint_out;
  1913   1915   
  1914   1916     /* Step the checkpoint object until it reports something other than 
  1915   1917     ** SQLITE_OK.  */
  1916   1918     while( SQLITE_OK==(rc = walCheckpointStep(&sC)) );
  1917   1919     rc = walCheckpointFinalize(&sC);
  1918   1920   
  1919   1921     /* If this is an SQLITE_CHECKPOINT_RESTART or TRUNCATE operation, and the