]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Attempt to fix the showwal.c utility program so that it works on WAL files
authordrh <>
Fri, 6 Aug 2021 19:38:23 +0000 (19:38 +0000)
committerdrh <>
Fri, 6 Aug 2021 19:38:23 +0000 (19:38 +0000)
larger than 4GiB.

FossilOrigin-Name: 5c0f9ea98a2b944857fe05d53a0143cb827b7d8215c37f33f1bce47ec1189952

manifest
manifest.uuid
tool/showwal.c

index ca6fa34ada8f7e15a346adbf046fbbb406300a1f..8273441511f4f4d0c592064f2de71efdd2991363 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sharmless\scompiler\swarnings.\s\sOmit\sredundant\scopies\sof\sos_common.h\sand\nhwtime.h\sfrom\sthe\samalgamation.
-D 2021-08-06T15:26:01.985
+C Attempt\sto\sfix\sthe\sshowwal.c\sutility\sprogram\sso\sthat\sit\sworks\son\sWAL\sfiles\nlarger\sthan\s4GiB.
+D 2021-08-06T19:38:23.599
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -1875,7 +1875,7 @@ F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818
 F tool/showlocks.c 9cc5e66d4ebbf2d194f39db2527ece92077e86ae627ddd233ee48e16e8142564
 F tool/showshm.c a0ab6ec32dd1f11218ca2a4018f8fb875b59414801ab8ceed8b2e69b7b45a809
 F tool/showstat4.c 0682ebea7abf4d3657f53c4a243f2e7eab48eab344ed36a94bb75dcd19a5c2a1
-F tool/showwal.c ad9d768f96ca6199ad3a8c9562d679680bd032dd01204ea3e5ea6fb931d81847
+F tool/showwal.c 0253c187ae16fdae9cde89e63e1dfcd3bb35e5416d066415f99e2f8cac6ab03d
 F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
 F tool/spaceanal.tcl 1b5be34c6223cb1af06da2a10fb77863eb869b1962d055820b0a11cf2336ab45
 F tool/speed-check.sh 8ba7c7c0dba37e664679974f5954f2282275271a5b92f890756e282df0bfc458
@@ -1920,7 +1920,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 832ac4c1ee384be0de72a4bdd55ed87e0f8294e7df5eefcf6b4942db3d85a69e
-R 9b8bf1cf8f9f47bbc3756297fbda6376
+P 091427007818537bb2f860c42dad867cb19050899186d4d180d195a1c6a98798
+R a7df768dc8afad426b142b0d7495573f
 U drh
-Z 8a1bbef3e175c4d55647fe110d7234dc
+Z 557b7104be9ed20145851a8d359fd9c8
index e79fd412a2b891683ae92bf1e4e41c651e86e094..c0d000055320330327113a54ef665ffabbc29639 100644 (file)
@@ -1 +1 @@
-091427007818537bb2f860c42dad867cb19050899186d4d180d195a1c6a98798
\ No newline at end of file
+5c0f9ea98a2b944857fe05d53a0143cb827b7d8215c37f33f1bce47ec1189952
\ No newline at end of file
index b214a288ebc1ae9fd94f448adf5b58f774df9d31..bc7406dc1a0636e1df3e9f6bedc948420cbaefbd 100644 (file)
@@ -117,7 +117,7 @@ static void out_of_memory(void){
 ** Space to hold the content is obtained from malloc() and needs to be
 ** freed by the caller.
 */
-static unsigned char *getContent(int ofst, int nByte){
+static unsigned char *getContent(i64 ofst, int nByte){
   unsigned char *aData;
   aData = malloc(nByte);
   if( aData==0 ) out_of_memory();
@@ -204,10 +204,10 @@ static void print_decode_line(
 ** Print an entire page of content as hex
 */
 static void print_frame(int iFrame){
-  int iStart;
+  i64 iStart;
   unsigned char *aData;
-  iStart = 32 + (iFrame-1)*(pagesize+24);
-  fprintf(stdout, "Frame %d:   (offsets 0x%x..0x%x)\n",
+  iStart = 32 + (i64)(iFrame-1)*(pagesize+24);
+  fprintf(stdout, "Frame %d:   (offsets 0x%llx..0x%llx)\n",
           iFrame, iStart, iStart+pagesize+24);
   aData = getContent(iStart, pagesize+24);
   print_decode_line(aData, 0, 4, 0, "Page number");
@@ -224,10 +224,10 @@ static void print_frame(int iFrame){
 ** Summarize a single frame on a single line.
 */
 static void print_oneline_frame(int iFrame, Cksum *pCksum){
-  int iStart;
+  i64 iStart;
   unsigned char *aData;
   unsigned int s0, s1;
-  iStart = 32 + (iFrame-1)*(pagesize+24);
+  iStart = 32 + (i64)(iFrame-1)*(pagesize+24);
   aData = getContent(iStart, 24);
   extendCksum(pCksum, aData, 8, 0);
   extendCksum(pCksum, getContent(iStart+24, pagesize), pagesize, 0);
@@ -564,7 +564,8 @@ int main(int argc, char **argv){
       }else if( zLeft && zLeft[0]=='.' && zLeft[1]=='.' ){
         iEnd = strtol(&zLeft[2], 0, 0);
       }else if( zLeft && zLeft[0]=='b' ){
-        int ofst, nByte, hdrSize;
+        i64 ofst;
+        int nByte, hdrSize;
         unsigned char *a;
         if( iStart==1 ){
           hdrSize = 100;
@@ -572,10 +573,10 @@ int main(int argc, char **argv){
           nByte = pagesize-100;
         }else{
           hdrSize = 0;
-          ofst = (iStart-1)*pagesize;
+          ofst = (i64)(iStart-1)*pagesize;
           nByte = pagesize;
         }
-        ofst = 32 + hdrSize + (iStart-1)*(pagesize+24) + 24;
+        ofst = 32 + hdrSize + (i64)(iStart-1)*(pagesize+24) + 24;
         a = getContent(ofst, nByte);
         decode_btree_page(a, iStart, hdrSize, zLeft+1);
         free(a);