mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Test that the correct number of padding frames are appended to the log file after committing a transaction in synchronous=FULL mode.
FossilOrigin-Name: a60104aa7e38e7d9f2ff2eae02687dc9c5dd5d77
This commit is contained in:
14
src/wal.c
14
src/wal.c
@@ -914,12 +914,12 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){
|
||||
** or not any cached pages may be safely reused.
|
||||
*/
|
||||
int sqlite3WalOpenSnapshot(Wal *pWal, int *pChanged){
|
||||
int rc;
|
||||
int rc; /* Return code */
|
||||
|
||||
rc = walSetLock(pWal, SQLITE_SHM_READ);
|
||||
if( rc==SQLITE_OK ){
|
||||
pWal->lockState = SQLITE_SHM_READ;
|
||||
assert( rc!=SQLITE_OK || pWal->lockState==SQLITE_SHM_READ );
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = walIndexReadHdr(pWal, pChanged);
|
||||
if( rc!=SQLITE_OK ){
|
||||
/* An error occured while attempting log recovery. */
|
||||
@@ -942,10 +942,10 @@ int sqlite3WalOpenSnapshot(Wal *pWal, int *pChanged){
|
||||
** Unlock the current snapshot.
|
||||
*/
|
||||
void sqlite3WalCloseSnapshot(Wal *pWal){
|
||||
if( pWal->lockState!=SQLITE_SHM_UNLOCK ){
|
||||
assert( pWal->lockState==SQLITE_SHM_READ );
|
||||
walSetLock(pWal, SQLITE_SHM_UNLOCK);
|
||||
}
|
||||
assert( pWal->lockState==SQLITE_SHM_READ
|
||||
|| pWal->lockState==SQLITE_SHM_UNLOCK
|
||||
);
|
||||
walSetLock(pWal, SQLITE_SHM_UNLOCK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user