diff options
Diffstat (limited to 'src/pager.c')
-rw-r--r-- | src/pager.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/pager.c b/src/pager.c index f6c8f2fa5..892c245b4 100644 --- a/src/pager.c +++ b/src/pager.c @@ -2516,20 +2516,21 @@ static int pager_truncate(Pager *pPager, Pgno nPage){ ** it is less than 32, or rounded down to MAX_SECTOR_SIZE if it ** is greater than MAX_SECTOR_SIZE. ** -** If the file has the SQLITE_IOCAP_ZERO_DAMAGE property, then set the -** effective sector size to its minimum value (512). The purpose of +** If the file has the SQLITE_IOCAP_POWERSAFE_OVERWRITE property, then set +** the effective sector size to its minimum value (512). The purpose of ** pPager->sectorSize is to define the "blast radius" of bytes that ** might change if a crash occurs while writing to a single byte in -** that range. But with ZERO_DAMAGE, the blast radius is zero, so -** we minimize the sector size. For backwards compatibility of the -** rollback journal file format, we cannot reduce the effective sector -** size below 512. +** that range. But with POWERSAFE_OVERWRITE, the blast radius is zero +** (that is what POWERSAFE_OVERWRITE means), so we minimize the sector +** size. For backwards compatibility of the rollback journal file format, +** we cannot reduce the effective sector size below 512. */ static void setSectorSize(Pager *pPager){ assert( isOpen(pPager->fd) || pPager->tempFile ); if( pPager->tempFile - || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_ZERO_DAMAGE)!=0 + || (sqlite3OsDeviceCharacteristics(pPager->fd) & + SQLITE_IOCAP_POWERSAFE_OVERWRITE)!=0 ){ /* Sector size doesn't matter for temporary files. Also, the file ** may not have been opened yet, in which case the OsSectorSize() |