diff options
author | drh <drh@noemail.net> | 2014-10-31 14:53:32 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-10-31 14:53:32 +0000 |
commit | ca3e10ea37c4808fa84063f06b02229801b28cc0 (patch) | |
tree | 25f7d9b2ab4ff71311882bcee951b6e9ab1cb62f /src/pager.c | |
parent | bc2866ca7abc2ad7cbb6878d65cd18e584cff8f5 (diff) | |
parent | 0fb5daed34ba6f16d761b8ad02b944ec59cf5c03 (diff) | |
download | sqlite-ca3e10ea37c4808fa84063f06b02229801b28cc0.tar.gz sqlite-ca3e10ea37c4808fa84063f06b02229801b28cc0.zip |
Merge recent trunk enhancements, and in particular the improvements to
the b-tree balancing logic, into the sessions branch.
FossilOrigin-Name: 28b044a51215a3f64dafb2cf3b6cb7d2029580ef
Diffstat (limited to 'src/pager.c')
-rw-r--r-- | src/pager.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pager.c b/src/pager.c index d3a36ef48..997f842d0 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1941,6 +1941,14 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ rc = SQLITE_OK; }else{ rc = sqlite3OsTruncate(pPager->jfd, 0); + if( rc==SQLITE_OK && pPager->fullSync ){ + /* Make sure the new file size is written into the inode right away. + ** Otherwise the journal might resurrect following a power loss and + ** cause the last transaction to roll back. See + ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773 + */ + rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags); + } } pPager->journalOff = 0; }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST @@ -6840,6 +6848,18 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ #endif /* +** The page handle passed as the first argument refers to a dirty page +** with a page number other than iNew. This function changes the page's +** page number to iNew and sets the value of the PgHdr.flags field to +** the value passed as the third parameter. +*/ +void sqlite3PagerRekey(DbPage *pPg, Pgno iNew, u16 flags){ + assert( pPg->pgno!=iNew ); + pPg->flags = flags; + sqlite3PcacheMove(pPg, iNew); +} + +/* ** Return a pointer to the data for the specified page. */ void *sqlite3PagerGetData(DbPage *pPg){ @@ -7237,4 +7257,5 @@ int sqlite3PagerWalFramesize(Pager *pPager){ } #endif + #endif /* SQLITE_OMIT_DISKIO */ |