diff options
author | drh <drh@noemail.net> | 2013-01-03 22:22:55 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-01-03 22:22:55 +0000 |
commit | 89ded43b3602fee3a703b7ca28b7536e9f8d6a03 (patch) | |
tree | bfed6cb44a3e38bbd7e5c0fd2abf4905b83e7963 /src/journal.c | |
parent | bd36911f4d3449cdcac15db56bb1bf5684e779d4 (diff) | |
parent | 26de1e99568c0f04a7956f2503bd9fcf007d85e6 (diff) | |
download | sqlite-89ded43b3602fee3a703b7ca28b7536e9f8d6a03.tar.gz sqlite-89ded43b3602fee3a703b7ca28b7536e9f8d6a03.zip |
Merge recent trunk changes into the sessions branch.
FossilOrigin-Name: 7e068e39b3b31364271664e0afb1cd95a235c26f
Diffstat (limited to 'src/journal.c')
-rw-r--r-- | src/journal.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/journal.c b/src/journal.c index 06605cc95..fed27be3e 100644 --- a/src/journal.c +++ b/src/journal.c @@ -59,6 +59,14 @@ static int createFile(JournalFile *p){ assert(p->iSize<=p->nBuf); rc = sqlite3OsWrite(p->pReal, p->zBuf, p->iSize, 0); } + if( rc!=SQLITE_OK ){ + /* If an error occurred while writing to the file, close it before + ** returning. This way, SQLite uses the in-memory journal data to + ** roll back changes made to the internal page-cache before this + ** function was called. */ + sqlite3OsClose(pReal); + p->pReal = 0; + } } } return rc; |