/ Check-in [a8f9bd1e]
Login

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

Overview
Comment:Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and when synchronous=FULL in order to ensure that transactions are durable across a power loss that happens moments after the commit. Proposed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1072773. This is a cherrypick of [3e922208b68563489].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.8.7
Files: files | file ages | folders
SHA1:a8f9bd1e890434fcffa02fcd2baf8b0fb5d4c9dd
User & Date: drh 2014-10-29 01:07:21
Context
2014-10-29
01:13
In the OP_Column opcode, when extracting a field that is past the end of a short record (because the row was originally inserted prior to ALTER TABLE ADD COLUMN) then make sure the output register is fully NULL and does not contain leftover flags (such as MEM_Ephem) from its previous use. Fix for ticket [43107840f1c02]. This is a cherrypick of check-in [24780f8ddc1683fc]. check-in: 304ea6ba user: drh tags: branch-3.8.7
01:07
Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and when synchronous=FULL in order to ensure that transactions are durable across a power loss that happens moments after the commit. Proposed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1072773. This is a cherrypick of [3e922208b68563489]. check-in: a8f9bd1e user: drh tags: branch-3.8.7
2014-10-21
21:56
Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and when synchronous=FULL in order to ensure that transactions are durable across a power loss that happens moments after the commit. Proposed fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1072773. check-in: 3e922208 user: drh tags: trunk
2014-10-17
11:24
Version 3.8.7 check-in: e4ab094f user: drh tags: trunk, release, version-3.8.7
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1937   1937         assert( pPager->journalMode==PAGER_JOURNALMODE_MEMORY );
  1938   1938         sqlite3OsClose(pPager->jfd);
  1939   1939       }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
  1940   1940         if( pPager->journalOff==0 ){
  1941   1941           rc = SQLITE_OK;
  1942   1942         }else{
  1943   1943           rc = sqlite3OsTruncate(pPager->jfd, 0);
         1944  +        if( rc==SQLITE_OK && pPager->fullSync ){
         1945  +          /* Make sure the new file size is written into the inode right away.
         1946  +          ** Otherwise the journal might resurrect following a power loss and
         1947  +          ** cause the last transaction to roll back.  See
         1948  +          ** https://bugzilla.mozilla.org/show_bug.cgi?id=1072773
         1949  +          */
         1950  +          rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags);
         1951  +        }
  1944   1952         }
  1945   1953         pPager->journalOff = 0;
  1946   1954       }else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
  1947   1955         || (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
  1948   1956       ){
  1949   1957         rc = zeroJournalHdr(pPager, hasMaster);
  1950   1958         pPager->journalOff = 0;