mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Fix bug in the premutation testing that was causing many permutations from
begin skipped. There are now 16 errors reported by the permutation test. (CVS 5610) FossilOrigin-Name: 4ad096bda1fc5c7b66f71ff5b32a4085c9a40574
This commit is contained in:
38
src/pager.c
38
src/pager.c
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.478 2008/08/25 07:12:29 danielk1977 Exp $
|
||||
** @(#) $Id: pager.c,v 1.479 2008/08/25 17:23:29 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -2495,29 +2495,27 @@ static int pagerStress(void *p, PgHdr *pPg){
|
||||
static int hasHotJournal(Pager *pPager, int *pExists){
|
||||
sqlite3_vfs *pVfs = pPager->pVfs;
|
||||
int rc = SQLITE_OK;
|
||||
int exists;
|
||||
int locked;
|
||||
assert( pPager!=0 );
|
||||
assert( pPager->useJournal );
|
||||
assert( pPager->fd->pMethods );
|
||||
*pExists = 0;
|
||||
if( pPager->useJournal && pPager->fd->pMethods ){
|
||||
int exists;
|
||||
int locked;
|
||||
|
||||
rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists);
|
||||
if( rc==SQLITE_OK && exists ){
|
||||
rc = sqlite3OsCheckReservedLock(pPager->fd, &locked);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK && exists && !locked ){
|
||||
int nPage;
|
||||
rc = sqlite3PagerPagecount(pPager, &nPage);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( nPage==0 ){
|
||||
sqlite3OsDelete(pVfs, pPager->zJournal, 0);
|
||||
}else{
|
||||
*pExists = 1;
|
||||
}
|
||||
rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists);
|
||||
if( rc==SQLITE_OK && exists ){
|
||||
rc = sqlite3OsCheckReservedLock(pPager->fd, &locked);
|
||||
}
|
||||
if( rc==SQLITE_OK && exists && !locked ){
|
||||
int nPage;
|
||||
rc = sqlite3PagerPagecount(pPager, &nPage);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( nPage==0 ){
|
||||
sqlite3OsDelete(pVfs, pPager->zJournal, 0);
|
||||
}else{
|
||||
*pExists = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user