1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Add tests cases for recovery in wal2 mode.

FossilOrigin-Name: 34f56f8a4239781071edf6317723d0a7333249551c2c1ce7ed39fc116d53d780
This commit is contained in:
dan
2018-12-13 16:26:43 +00:00
parent eeb778d506
commit 597bf19266
5 changed files with 194 additions and 14 deletions

View File

@@ -1656,8 +1656,8 @@ static int walIndexRecover(Wal *pWal){
/* The case where *-wal2 may follow *-wal */
if( nCkpt2<=0x0F && nCkpt2==nCkpt1+1 ){
if( sqlite3Get4byte((u8*)(&pWal->hdr.aSalt[0]))==hdr.aFrameCksum[0]
&& sqlite3Get4byte((u8*)(&pWal->hdr.aSalt[1]))==hdr.aFrameCksum[1]
){
&& sqlite3Get4byte((u8*)(&pWal->hdr.aSalt[1]))==hdr.aFrameCksum[1]
){
walidxSetFile(&pWal->hdr, 1);
walidxSetMxFrame(&pWal->hdr, 1, pWal->hdr.mxFrame);
walidxSetMxFrame(&pWal->hdr, 0, hdr.mxFrame);
@@ -1715,9 +1715,9 @@ static int walIndexRecover(Wal *pWal){
if( pWal->hdr.nPage ){
if( isWalMode2(pWal) ){
sqlite3_log(SQLITE_NOTICE_RECOVER_WAL,
"recovered (%d,%d) frames from WAL files %s[2] (%s mode)",
"recovered (%d,%d) frames from WAL files %s[2] (wal2 mode)",
walidxGetMxFrame(&pWal->hdr, 0), walidxGetMxFrame(&pWal->hdr, 1),
pWal->zWalName, isWalMode2(pWal) ? "wal2" : "wal"
pWal->zWalName
);
}else{
sqlite3_log(SQLITE_NOTICE_RECOVER_WAL,