SQLite

Check-in [6a505bdd93]
Login

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

Overview
Comment:More precise determination of when an in-memory journal needs to be spilled to disk.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | batch-atomic-write
Files: files | file ages | folders
SHA3-256: 6a505bdd9347783d3d8105cb8185aa787801bad0c855b623cfd780fb406f0e7b
User & Date: drh 2017-07-28 18:16:14.317
Context
2017-07-28
20:49
Disable the writecrash.test module on Windows. (Leaf check-in: 4c0520d4df user: drh tags: batch-atomic-write)
18:16
More precise determination of when an in-memory journal needs to be spilled to disk. (check-in: 6a505bdd93 user: drh tags: batch-atomic-write)
13:18
Add new extended error codes for the atomic write file-controls. (check-in: 94a2004756 user: drh tags: batch-atomic-write)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/memjournal.c.
393
394
395
396
397
398
399
400








401
402
403
404
405
406
407
** in-memory-only journal file (i.e. is one that was opened with a +ve
** nSpill parameter or as SQLITE_OPEN_MAIN_JOURNAL), and the underlying 
** file has not yet been created, create it now.
*/
int sqlite3JournalCreate(sqlite3_file *pJfd){
  int rc = SQLITE_OK;
  MemJournal *p = (MemJournal*)pJfd;
  if( p->pMethod==&MemJournalMethods && (p->nSpill>0 








#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE
     || (p->flags & SQLITE_OPEN_MAIN_JOURNAL)
#endif
  )){
    rc = memjrnlCreateFile(p);
  }
  return rc;







|
>
>
>
>
>
>
>
>







393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
** in-memory-only journal file (i.e. is one that was opened with a +ve
** nSpill parameter or as SQLITE_OPEN_MAIN_JOURNAL), and the underlying 
** file has not yet been created, create it now.
*/
int sqlite3JournalCreate(sqlite3_file *pJfd){
  int rc = SQLITE_OK;
  MemJournal *p = (MemJournal*)pJfd;
  if( p->pMethod==&MemJournalMethods && (
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
     p->nSpill>0
#else
     /* While this appears to not be possible without ATOMIC_WRITE, the
     ** paths are complex, so it seems prudent to leave the test in as
     ** a NEVER(), in case our analysis is subtly flawed. */
     NEVER(p->nSpill>0)
#endif
#ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE
     || (p->flags & SQLITE_OPEN_MAIN_JOURNAL)
#endif
  )){
    rc = memjrnlCreateFile(p);
  }
  return rc;