/ Check-in [38d31e18]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:If SQLITE_ENABLE_ZIPVFS is defined, journal_mode=off is configured and a savepoint or statement rollback is attempted, move the pager into the error state to prevent the transaction from being committed. This makes it safe to use journal_mode=off with zipvfs under some conditions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 38d31e189e7c7899e14455f2c083aa676ce4d4c0
User & Date: dan 2016-09-01 09:35:20
Context
2016-09-01
14:03
Have "sqldiff --rbu" ignore rows with NULL values in primary key fields. RBU can't handle such rows and the documentation already says sqldiff ignores them. Because the code now uses "=" instead of "IS" to filter on primary key columns, diffs on virtual tables are faster now too. check-in: f4ba894a user: dan tags: trunk
09:35
If SQLITE_ENABLE_ZIPVFS is defined, journal_mode=off is configured and a savepoint or statement rollback is attempted, move the pager into the error state to prevent the transaction from being committed. This makes it safe to use journal_mode=off with zipvfs under some conditions. check-in: 38d31e18 user: dan tags: trunk
2016-08-29
14:18
Use some of the example code from the sessions documenatation in the sessions test cases. check-in: 6602974d user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  6652   6652   ** then savepoint iSavepoint is also destroyed.
  6653   6653   **
  6654   6654   ** This function may return SQLITE_NOMEM if a memory allocation fails,
  6655   6655   ** or an IO error code if an IO error occurs while rolling back a 
  6656   6656   ** savepoint. If no errors occur, SQLITE_OK is returned.
  6657   6657   */ 
  6658   6658   int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){
  6659         -  int rc = pPager->errCode;       /* Return code */
         6659  +  int rc = pPager->errCode;
         6660  +  
         6661  +#ifdef SQLITE_ENABLE_ZIPVFS
         6662  +  if( op==SAVEPOINT_RELEASE ) rc = SQLITE_OK;
         6663  +#endif
  6660   6664   
  6661   6665     assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK );
  6662   6666     assert( iSavepoint>=0 || op==SAVEPOINT_ROLLBACK );
  6663   6667   
  6664   6668     if( rc==SQLITE_OK && iSavepoint<pPager->nSavepoint ){
  6665   6669       int ii;            /* Iterator variable */
  6666   6670       int nNew;          /* Number of remaining savepoints after this op. */
................................................................................
  6693   6697       ** the database file, so the playback operation can be skipped.
  6694   6698       */
  6695   6699       else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){
  6696   6700         PagerSavepoint *pSavepoint = (nNew==0)?0:&pPager->aSavepoint[nNew-1];
  6697   6701         rc = pagerPlaybackSavepoint(pPager, pSavepoint);
  6698   6702         assert(rc!=SQLITE_DONE);
  6699   6703       }
         6704  +    
         6705  +#ifdef SQLITE_ENABLE_ZIPVFS
         6706  +    /* If the cache has been modified but the savepoint cannot be rolled 
         6707  +    ** back journal_mode=off, put the pager in the error state. This way,
         6708  +    ** if the VFS used by this pager includes ZipVFS, the entire transaction
         6709  +    ** can be rolled back at the ZipVFS level.  */
         6710  +    else if( 
         6711  +        pPager->journalMode==PAGER_JOURNALMODE_OFF 
         6712  +     && pPager->eState>=PAGER_WRITER_CACHEMOD
         6713  +    ){
         6714  +      pPager->errCode = SQLITE_ABORT;
         6715  +      pPager->eState = PAGER_ERROR;
         6716  +    }
         6717  +#endif
  6700   6718     }
  6701   6719   
  6702   6720     return rc;
  6703   6721   }
  6704   6722   
  6705   6723   /*
  6706   6724   ** Return the full pathname of the database file.