Mark a condition in wal.c as ALWAYS().

FossilOrigin-Name: 3fe0cc784ac586358c08f87fba458dfbb5eec6f2
This commit is contained in:
dan 2010-06-05 14:42:57 +00:00
parent ef4ee8f274
commit 0626bd65fb
3 changed files with 23 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Add\sextra\scoverage\stest\scases\sfor\swal.c.\sNo\schanges\sto\sproduction\scode. C Mark\sa\scondition\sin\swal.c\sas\sALWAYS().
D 2010-06-05T11:53:34 D 2010-06-05T14:42:58
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -224,7 +224,7 @@ F src/vdbeblob.c 5327132a42a91e8b7acfb60b9d2c3b1c5c863e0e
F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1 F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1
F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2
F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda
F src/wal.c e237581eeb99a9c766419e824c766ac67f37adb9 F src/wal.c 3a448ad3a563b7b9fe6982e69f56fab327eda196
F src/wal.h 4ace25262452d17e7d3ec970c89ee17794004008 F src/wal.h 4ace25262452d17e7d3ec970c89ee17794004008
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
F src/where.c 75fee9e255b62f773fcadd1d1f25b6f63ac7a356 F src/where.c 75fee9e255b62f773fcadd1d1f25b6f63ac7a356
@ -817,7 +817,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 255850699ddbf4aad8cc3223aefbada35daa0703 P f9d4ae0e8cc5d32c52eb78799f7959dd236ea9de
R 7ac85a4afc11bde0cbb8862c4d4688fc R 354467ef49285b1e7f4721d72defda65
U dan U dan
Z 575989e6baec836caf7d32e1a4d39d95 Z 2159f852b96b4a4c0e2c6c207c85dab6

View File

@ -1 +1 @@
f9d4ae0e8cc5d32c52eb78799f7959dd236ea9de 3fe0cc784ac586358c08f87fba458dfbb5eec6f2

View File

@ -2085,8 +2085,23 @@ int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){
rc = walIndexMap(pWal, walMappingSize(iMax)); rc = walIndexMap(pWal, walMappingSize(iMax));
} }
if( rc==SQLITE_OK ){ if( rc==SQLITE_OK ){
for(iFrame=pWal->hdr.mxFrame+1; rc==SQLITE_OK && iFrame<=iMax; iFrame++){ for(iFrame=pWal->hdr.mxFrame+1;
ALWAYS(rc==SQLITE_OK) && iFrame<=iMax;
iFrame++
){
/* This call cannot fail. Unless the page for which the page number
** is passed as the second argument is (a) in the cache and
** (b) has an outstanding reference, then xUndo is either a no-op
** (if (a) is false) or simply expels the page from the cache (if (b)
** is false).
**
** If the upper layer is doing a rollback, it is guaranteed that there
** are no outstanding references to any page other than page 1. And
** page 1 is never written to the log until the transaction is
** committed. As a result, the call to xUndo may not fail.
*/
assert( pWal->writeLock ); assert( pWal->writeLock );
assert( pWal->pWiData[walIndexEntry(iFrame)]!=1 );
rc = xUndo(pUndoCtx, pWal->pWiData[walIndexEntry(iFrame)]); rc = xUndo(pUndoCtx, pWal->pWiData[walIndexEntry(iFrame)]);
} }
walCleanupHash(pWal); walCleanupHash(pWal);