1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix a couple of assert() statements in os_unix.c and wal.c. Combine sqlite3WalIsDirty() with sqlite3WalUndo().

FossilOrigin-Name: a8f958be804ee05c4137b3cd110db344713af5f2
This commit is contained in:
dan
2010-04-30 09:52:17 +00:00
parent ba51590bcd
commit 4c97b53425
6 changed files with 22 additions and 35 deletions

View File

@@ -829,7 +829,7 @@ int walIndexTryHdr(Wal *pWal, int *pChanged){
static int walIndexReadHdr(Wal *pWal, int *pChanged){
int rc;
assert( pWal->lockState==SQLITE_SHM_READ );
assert( pWal->lockState>=SQLITE_SHM_READ );
walIndexMap(pWal);
/* First try to read the header without a lock. Verify the checksum
@@ -1053,14 +1053,6 @@ int sqlite3WalSavepointUndo(Wal *pWal, u32 iFrame){
return rc;
}
/*
** Return true if data has been written but not committed to the log file.
*/
int sqlite3WalDirty(Wal *pWal){
assert( pWal->lockState==SQLITE_SHM_WRITE );
return( pWal->hdr.iLastPg!=((WalIndexHdr*)pWal->pWiData)->iLastPg );
}
/*
** Write a set of frames to the log. The caller must hold the write-lock
** on the log file (obtained using sqlite3WalWriteLock()).