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

Further reduction in divergence from trunk.

FossilOrigin-Name: e4406a6e2660f1f42614d0034d024cc206109ac71e9f8b289aeed2eba20be8e9
This commit is contained in:
drh
2024-12-16 18:13:47 +00:00
parent 6b716403f9
commit 5cf971bdc7
3 changed files with 16 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
C Reduce\sdivergence\sof\swal2\sfrom\strunk. C Further\sreduction\sin\sdivergence\sfrom\strunk.
D 2024-12-16T17:46:21.982 D 2024-12-16T18:13:47.246
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@@ -860,7 +860,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3 F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
F src/vtab.c 316cd48e9320660db3047cd306cd056e4361180cebb4d0f10a39244e10c11422 F src/vtab.c 316cd48e9320660db3047cd306cd056e4361180cebb4d0f10a39244e10c11422
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c f5588f5e2d04afcf49add28b866cc76e4af2e2d8d2531486ac98f502bf8ca93c F src/wal.c 3ff22607c591f208bf81b5ea2160e5715d12bbb5b762394f79b2bd13d3f7568b
F src/wal.h 97b8a9903387401377b59507e86b93a148ef1ad4e5ce0f23659a12dcdce56af2 F src/wal.h 97b8a9903387401377b59507e86b93a148ef1ad4e5ce0f23659a12dcdce56af2
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014 F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
F src/where.c 9ad3dea8003a8913da6a4ca8322e2fe30773f46e88a0d4fbf9db13bdb999efa2 F src/where.c 9ad3dea8003a8913da6a4ca8322e2fe30773f46e88a0d4fbf9db13bdb999efa2
@@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P eab619453abf6979962a68d298c44553ef0d9eb18112e61420d4de8a9c16f620 P 90d744d67446a270f7547910531e76593dee82ce537e75c11af0d94eca8404cf
R 80e0eedebdef6156cabc3ad9fa1485f5 R a440747468661c427837f99ee412b9ae
U drh U drh
Z d17a5f7761993d7328d68cbb53bd5978 Z 0ce636ddd1ec473c89130c2c2fee8b2e
# Remove this line to create a well-formed Fossil manifest. # Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
90d744d67446a270f7547910531e76593dee82ce537e75c11af0d94eca8404cf e4406a6e2660f1f42614d0034d024cc206109ac71e9f8b289aeed2eba20be8e9

View File

@@ -3746,15 +3746,16 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){
pWal->readLock = eLock; pWal->readLock = eLock;
} }
assert( pWal->minFrame==0 && walFramePage(pWal->minFrame)==0 ); assert( pWal->minFrame==0 && walFramePage(pWal->minFrame)==0 );
}else{ }else
{
u32 mxReadMark; /* Largest aReadMark[] value */ u32 mxReadMark; /* Largest aReadMark[] value */
int mxI; /* Index of largest aReadMark[] value */ int mxI; /* Index of largest aReadMark[] value */
int i; /* Loop counter */ int i; /* Loop counter */
u32 mxFrame; /* Wal frame to lock to */ u32 mxFrame; /* Wal frame to lock to */
if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame
#ifdef SQLITE_ENABLE_SNAPSHOT #ifdef SQLITE_ENABLE_SNAPSHOT
&& ((pWal->bGetSnapshot==0 && pWal->pSnapshot==0) || pWal->hdr.mxFrame==0) && ((pWal->bGetSnapshot==0 && pWal->pSnapshot==0) || pWal->hdr.mxFrame==0)
#endif #endif
){ ){
/* The WAL has been completely backfilled (or it is empty). /* The WAL has been completely backfilled (or it is empty).
** and can be safely ignored. ** and can be safely ignored.
@@ -3770,7 +3771,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){
** snapshot. Since holding READ_LOCK(0) prevents a checkpoint from ** snapshot. Since holding READ_LOCK(0) prevents a checkpoint from
** happening, this is usually correct. ** happening, this is usually correct.
** **
** However, if frames have been appended to the log (or if the log ** However, if frames have been appended to the log (or if the log
** is wrapped and written for that matter) before the READ_LOCK(0) ** is wrapped and written for that matter) before the READ_LOCK(0)
** is obtained, that is not necessarily true. A checkpointer may ** is obtained, that is not necessarily true. A checkpointer may
** have started to backfill the appended frames but crashed before ** have started to backfill the appended frames but crashed before
@@ -3794,11 +3795,11 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){
mxReadMark = 0; mxReadMark = 0;
mxI = 0; mxI = 0;
mxFrame = pWal->hdr.mxFrame; mxFrame = pWal->hdr.mxFrame;
#ifdef SQLITE_ENABLE_SNAPSHOT #ifdef SQLITE_ENABLE_SNAPSHOT
if( pWal->pSnapshot && pWal->pSnapshot->mxFrame<mxFrame ){ if( pWal->pSnapshot && pWal->pSnapshot->mxFrame<mxFrame ){
mxFrame = pWal->pSnapshot->mxFrame; mxFrame = pWal->pSnapshot->mxFrame;
} }
#endif #endif
for(i=1; i<WAL_NREADER; i++){ for(i=1; i<WAL_NREADER; i++){
u32 thisMark = AtomicLoad(pInfo->aReadMark+i); SEH_INJECT_FAULT; u32 thisMark = AtomicLoad(pInfo->aReadMark+i); SEH_INJECT_FAULT;
if( mxReadMark<=thisMark && thisMark<=mxFrame ){ if( mxReadMark<=thisMark && thisMark<=mxFrame ){
@@ -3841,7 +3842,6 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){
#endif #endif
assert((rc&0xFF)!=SQLITE_BUSY||rc==SQLITE_BUSY||rc==SQLITE_BUSY_TIMEOUT); assert((rc&0xFF)!=SQLITE_BUSY||rc==SQLITE_BUSY||rc==SQLITE_BUSY_TIMEOUT);
return (rc&0xFF)==SQLITE_BUSY ? WAL_RETRY : rc; return (rc&0xFF)==SQLITE_BUSY ? WAL_RETRY : rc;
} }
/* Now that the read-lock has been obtained, check that neither the /* Now that the read-lock has been obtained, check that neither the
** value in the aReadMark[] array or the contents of the wal-index ** value in the aReadMark[] array or the contents of the wal-index
@@ -3863,9 +3863,9 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){
** to read any frames earlier than minFrame from the wal file - they ** to read any frames earlier than minFrame from the wal file - they
** can be safely read directly from the database file. ** can be safely read directly from the database file.
** **
** Because a ShmBarrier() call is made between taking the copy of ** Because a ShmBarrier() call is made between taking the copy of
** nBackfill and checking that the wal-header in shared-memory still ** nBackfill and checking that the wal-header in shared-memory still
** matches the one cached in pWal->hdr, it is guaranteed that the ** matches the one cached in pWal->hdr, it is guaranteed that the
** checkpointer that set nBackfill was not working with a wal-index ** checkpointer that set nBackfill was not working with a wal-index
** header newer than that cached in pWal->hdr. If it were, that could ** header newer than that cached in pWal->hdr. If it were, that could
** cause a problem. The checkpointer could omit to checkpoint ** cause a problem. The checkpointer could omit to checkpoint
@@ -4671,7 +4671,6 @@ static int walRestartLog(Wal *pWal){
testcase( rc==SQLITE_PROTOCOL ); testcase( rc==SQLITE_PROTOCOL );
testcase( rc==SQLITE_OK ); testcase( rc==SQLITE_OK );
} }
return rc; return rc;
} }