Fossil SCM

Fix frame number computations in the timestamp VFS.

drh 2026-01-27 11:21 timestamp-vfs
Commit 7e63541cddb482cc2bd0bfac125107d76ccba8d4471115fadbb14dc7ec44cce2
1 file changed +2 -2
--- extsrc/tmstmpvfs.c
+++ extsrc/tmstmpvfs.c
@@ -534,11 +534,11 @@
534534
}
535535
if( p->isWal
536536
&& p->inCkpt
537537
&& iAmt>=512 && iAmt<=65535 && (iAmt&(iAmt-1))==0
538538
){
539
- p->pPartner->iFrame = (iOfst - 8)/(p->pgsz + 48) + 1;
539
+ p->pPartner->iFrame = (iOfst-56)/(p->pgsz+24) + 1;
540540
}
541541
return rc;
542542
}
543543
544544
/*
@@ -557,11 +557,11 @@
557557
}else if( p->isWal ){
558558
/* Writing into a WAL file */
559559
if( iAmt==24 ){
560560
/* A frame header */
561561
u32 x = 0;
562
- p->iFrame = (iOfst - 32)/(p->pgsz+24);
562
+ p->iFrame = (iOfst - 32)/(p->pgsz+24)+1;
563563
p->pgno = tmstmpGetU32((const u8*)zBuf);
564564
p->salt1 = tmstmpGetU32(((const u8*)zBuf)+8);
565565
memcpy(&x, ((const u8*)zBuf)+4, 4);
566566
p->isCommit = (x!=0);
567567
p->iOfst = iOfst;
568568
--- extsrc/tmstmpvfs.c
+++ extsrc/tmstmpvfs.c
@@ -534,11 +534,11 @@
534 }
535 if( p->isWal
536 && p->inCkpt
537 && iAmt>=512 && iAmt<=65535 && (iAmt&(iAmt-1))==0
538 ){
539 p->pPartner->iFrame = (iOfst - 8)/(p->pgsz + 48) + 1;
540 }
541 return rc;
542 }
543
544 /*
@@ -557,11 +557,11 @@
557 }else if( p->isWal ){
558 /* Writing into a WAL file */
559 if( iAmt==24 ){
560 /* A frame header */
561 u32 x = 0;
562 p->iFrame = (iOfst - 32)/(p->pgsz+24);
563 p->pgno = tmstmpGetU32((const u8*)zBuf);
564 p->salt1 = tmstmpGetU32(((const u8*)zBuf)+8);
565 memcpy(&x, ((const u8*)zBuf)+4, 4);
566 p->isCommit = (x!=0);
567 p->iOfst = iOfst;
568
--- extsrc/tmstmpvfs.c
+++ extsrc/tmstmpvfs.c
@@ -534,11 +534,11 @@
534 }
535 if( p->isWal
536 && p->inCkpt
537 && iAmt>=512 && iAmt<=65535 && (iAmt&(iAmt-1))==0
538 ){
539 p->pPartner->iFrame = (iOfst-56)/(p->pgsz+24) + 1;
540 }
541 return rc;
542 }
543
544 /*
@@ -557,11 +557,11 @@
557 }else if( p->isWal ){
558 /* Writing into a WAL file */
559 if( iAmt==24 ){
560 /* A frame header */
561 u32 x = 0;
562 p->iFrame = (iOfst - 32)/(p->pgsz+24)+1;
563 p->pgno = tmstmpGetU32((const u8*)zBuf);
564 p->salt1 = tmstmpGetU32(((const u8*)zBuf)+8);
565 memcpy(&x, ((const u8*)zBuf)+4, 4);
566 p->isCommit = (x!=0);
567 p->iOfst = iOfst;
568

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button