1
0
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:
dan
2010-05-04 10:36:20 +00:00
parent d0b2677b78
commit 8d6ad1cc2c
5 changed files with 115 additions and 39 deletions

View File

@@ -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);
}
/*