diff options
author | dan <dan@noemail.net> | 2017-07-20 21:00:03 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2017-07-20 21:00:03 +0000 |
commit | d67a97705caa0951a32b6720cc0cbabf14f8c2bf (patch) | |
tree | 301004ecd8264ec6b5b898798355bdf4ad84633a /src/memjournal.c | |
parent | efe16971913201fd678f6159cc92fe41aaf49384 (diff) | |
download | sqlite-d67a97705caa0951a32b6720cc0cbabf14f8c2bf.tar.gz sqlite-d67a97705caa0951a32b6720cc0cbabf14f8c2bf.zip |
Split SQLITE_ENABLE_ATOMIC_WRITE into two options - the original and
SQLITE_ENABLE_BATCH_ATOMIC_WRITE.
FossilOrigin-Name: 7eb9bf2c5b42c39901fd571553c1f70aa5a9dac71fdc8e318b3063b928ad58f7
Diffstat (limited to 'src/memjournal.c')
-rw-r--r-- | src/memjournal.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/memjournal.c b/src/memjournal.c index cc5f73e22..493eb9a3b 100644 --- a/src/memjournal.c +++ b/src/memjournal.c @@ -96,7 +96,8 @@ static int memjrnlRead( int iChunkOffset; FileChunk *pChunk; -#ifdef SQLITE_ENABLE_ATOMIC_WRITE +#ifdef SQLITE_ENABLE_ATOMIC_WRITE \ + || defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE) if( (iAmt+iOfst)>p->endpoint.iOffset ){ return SQLITE_IOERR_SHORT_READ; } @@ -215,7 +216,8 @@ static int memjrnlWrite( ** atomic-write optimization. In this case the first 28 bytes of the ** journal file may be written as part of committing the transaction. */ assert( iOfst==p->endpoint.iOffset || iOfst==0 ); -#ifdef SQLITE_ENABLE_ATOMIC_WRITE +#ifdef SQLITE_ENABLE_ATOMIC_WRITE \ + || defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE) if( iOfst==0 && p->pFirst ){ assert( p->nChunkSize>iAmt ); memcpy((u8*)p->pFirst->zChunk, zBuf, iAmt); @@ -384,7 +386,8 @@ void sqlite3MemJournalOpen(sqlite3_file *pJfd){ sqlite3JournalOpen(0, 0, pJfd, 0, -1); } -#ifdef SQLITE_ENABLE_ATOMIC_WRITE +#if defined(SQLITE_ENABLE_ATOMIC_WRITE) \ + || defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE) /* ** If the argument p points to a MemJournal structure that is not an ** in-memory-only journal file (i.e. is one that was opened with a +ve @@ -394,9 +397,11 @@ void sqlite3MemJournalOpen(sqlite3_file *pJfd){ int sqlite3JournalCreate(sqlite3_file *pJfd){ int rc = SQLITE_OK; MemJournal *p = (MemJournal*)pJfd; - if( p->pMethod==&MemJournalMethods - && (p->nSpill>0 || (p->flags & SQLITE_OPEN_MAIN_JOURNAL)) - ){ + 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; |