Fossil SCM
Fix frame number computations in the timestamp VFS.
Commit
7e63541cddb482cc2bd0bfac125107d76ccba8d4471115fadbb14dc7ec44cce2
Parent
2a1a9c357e1a882…
1 file changed
+2
-2
+2
-2
| --- extsrc/tmstmpvfs.c | ||
| +++ extsrc/tmstmpvfs.c | ||
| @@ -534,11 +534,11 @@ | ||
| 534 | 534 | } |
| 535 | 535 | if( p->isWal |
| 536 | 536 | && p->inCkpt |
| 537 | 537 | && iAmt>=512 && iAmt<=65535 && (iAmt&(iAmt-1))==0 |
| 538 | 538 | ){ |
| 539 | - p->pPartner->iFrame = (iOfst - 8)/(p->pgsz + 48) + 1; | |
| 539 | + p->pPartner->iFrame = (iOfst-56)/(p->pgsz+24) + 1; | |
| 540 | 540 | } |
| 541 | 541 | return rc; |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | /* |
| @@ -557,11 +557,11 @@ | ||
| 557 | 557 | }else if( p->isWal ){ |
| 558 | 558 | /* Writing into a WAL file */ |
| 559 | 559 | if( iAmt==24 ){ |
| 560 | 560 | /* A frame header */ |
| 561 | 561 | u32 x = 0; |
| 562 | - p->iFrame = (iOfst - 32)/(p->pgsz+24); | |
| 562 | + p->iFrame = (iOfst - 32)/(p->pgsz+24)+1; | |
| 563 | 563 | p->pgno = tmstmpGetU32((const u8*)zBuf); |
| 564 | 564 | p->salt1 = tmstmpGetU32(((const u8*)zBuf)+8); |
| 565 | 565 | memcpy(&x, ((const u8*)zBuf)+4, 4); |
| 566 | 566 | p->isCommit = (x!=0); |
| 567 | 567 | p->iOfst = iOfst; |
| 568 | 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 - 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 |