mirror of
				https://github.com/sqlite/sqlite.git
				synced 2025-11-03 16:53:36 +03:00 
			
		
		
		
	Attempt to fix the showwal.c utility program so that it works on WAL files
larger than 4GiB. FossilOrigin-Name: 5c0f9ea98a2b944857fe05d53a0143cb827b7d8215c37f33f1bce47ec1189952
This commit is contained in:
		
							
								
								
									
										12
									
								
								manifest
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								manifest
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
				
			|||||||
C Fix\sharmless\scompiler\swarnings.\s\sOmit\sredundant\scopies\sof\sos_common.h\sand\nhwtime.h\sfrom\sthe\samalgamation.
 | 
					C Attempt\sto\sfix\sthe\sshowwal.c\sutility\sprogram\sso\sthat\sit\sworks\son\sWAL\sfiles\nlarger\sthan\s4GiB.
 | 
				
			||||||
D 2021-08-06T15:26:01.985
 | 
					D 2021-08-06T19:38:23.599
 | 
				
			||||||
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 df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
 | 
					F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
 | 
				
			||||||
@@ -1875,7 +1875,7 @@ F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818
 | 
				
			|||||||
F tool/showlocks.c 9cc5e66d4ebbf2d194f39db2527ece92077e86ae627ddd233ee48e16e8142564
 | 
					F tool/showlocks.c 9cc5e66d4ebbf2d194f39db2527ece92077e86ae627ddd233ee48e16e8142564
 | 
				
			||||||
F tool/showshm.c a0ab6ec32dd1f11218ca2a4018f8fb875b59414801ab8ceed8b2e69b7b45a809
 | 
					F tool/showshm.c a0ab6ec32dd1f11218ca2a4018f8fb875b59414801ab8ceed8b2e69b7b45a809
 | 
				
			||||||
F tool/showstat4.c 0682ebea7abf4d3657f53c4a243f2e7eab48eab344ed36a94bb75dcd19a5c2a1
 | 
					F tool/showstat4.c 0682ebea7abf4d3657f53c4a243f2e7eab48eab344ed36a94bb75dcd19a5c2a1
 | 
				
			||||||
F tool/showwal.c ad9d768f96ca6199ad3a8c9562d679680bd032dd01204ea3e5ea6fb931d81847
 | 
					F tool/showwal.c 0253c187ae16fdae9cde89e63e1dfcd3bb35e5416d066415f99e2f8cac6ab03d
 | 
				
			||||||
F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
 | 
					F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
 | 
				
			||||||
F tool/spaceanal.tcl 1b5be34c6223cb1af06da2a10fb77863eb869b1962d055820b0a11cf2336ab45
 | 
					F tool/spaceanal.tcl 1b5be34c6223cb1af06da2a10fb77863eb869b1962d055820b0a11cf2336ab45
 | 
				
			||||||
F tool/speed-check.sh 8ba7c7c0dba37e664679974f5954f2282275271a5b92f890756e282df0bfc458
 | 
					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.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 | 
				
			||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 | 
					F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 | 
				
			||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
 | 
					F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
 | 
				
			||||||
P 832ac4c1ee384be0de72a4bdd55ed87e0f8294e7df5eefcf6b4942db3d85a69e
 | 
					P 091427007818537bb2f860c42dad867cb19050899186d4d180d195a1c6a98798
 | 
				
			||||||
R 9b8bf1cf8f9f47bbc3756297fbda6376
 | 
					R a7df768dc8afad426b142b0d7495573f
 | 
				
			||||||
U drh
 | 
					U drh
 | 
				
			||||||
Z 8a1bbef3e175c4d55647fe110d7234dc
 | 
					Z 557b7104be9ed20145851a8d359fd9c8
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1 +1 @@
 | 
				
			|||||||
091427007818537bb2f860c42dad867cb19050899186d4d180d195a1c6a98798
 | 
					5c0f9ea98a2b944857fe05d53a0143cb827b7d8215c37f33f1bce47ec1189952
 | 
				
			||||||
@@ -117,7 +117,7 @@ static void out_of_memory(void){
 | 
				
			|||||||
** Space to hold the content is obtained from malloc() and needs to be
 | 
					** Space to hold the content is obtained from malloc() and needs to be
 | 
				
			||||||
** freed by the caller.
 | 
					** freed by the caller.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
static unsigned char *getContent(int ofst, int nByte){
 | 
					static unsigned char *getContent(i64 ofst, int nByte){
 | 
				
			||||||
  unsigned char *aData;
 | 
					  unsigned char *aData;
 | 
				
			||||||
  aData = malloc(nByte);
 | 
					  aData = malloc(nByte);
 | 
				
			||||||
  if( aData==0 ) out_of_memory();
 | 
					  if( aData==0 ) out_of_memory();
 | 
				
			||||||
@@ -204,10 +204,10 @@ static void print_decode_line(
 | 
				
			|||||||
** Print an entire page of content as hex
 | 
					** Print an entire page of content as hex
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
static void print_frame(int iFrame){
 | 
					static void print_frame(int iFrame){
 | 
				
			||||||
  int iStart;
 | 
					  i64 iStart;
 | 
				
			||||||
  unsigned char *aData;
 | 
					  unsigned char *aData;
 | 
				
			||||||
  iStart = 32 + (iFrame-1)*(pagesize+24);
 | 
					  iStart = 32 + (i64)(iFrame-1)*(pagesize+24);
 | 
				
			||||||
  fprintf(stdout, "Frame %d:   (offsets 0x%x..0x%x)\n",
 | 
					  fprintf(stdout, "Frame %d:   (offsets 0x%llx..0x%llx)\n",
 | 
				
			||||||
          iFrame, iStart, iStart+pagesize+24);
 | 
					          iFrame, iStart, iStart+pagesize+24);
 | 
				
			||||||
  aData = getContent(iStart, pagesize+24);
 | 
					  aData = getContent(iStart, pagesize+24);
 | 
				
			||||||
  print_decode_line(aData, 0, 4, 0, "Page number");
 | 
					  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.
 | 
					** Summarize a single frame on a single line.
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
static void print_oneline_frame(int iFrame, Cksum *pCksum){
 | 
					static void print_oneline_frame(int iFrame, Cksum *pCksum){
 | 
				
			||||||
  int iStart;
 | 
					  i64 iStart;
 | 
				
			||||||
  unsigned char *aData;
 | 
					  unsigned char *aData;
 | 
				
			||||||
  unsigned int s0, s1;
 | 
					  unsigned int s0, s1;
 | 
				
			||||||
  iStart = 32 + (iFrame-1)*(pagesize+24);
 | 
					  iStart = 32 + (i64)(iFrame-1)*(pagesize+24);
 | 
				
			||||||
  aData = getContent(iStart, 24);
 | 
					  aData = getContent(iStart, 24);
 | 
				
			||||||
  extendCksum(pCksum, aData, 8, 0);
 | 
					  extendCksum(pCksum, aData, 8, 0);
 | 
				
			||||||
  extendCksum(pCksum, getContent(iStart+24, pagesize), pagesize, 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]=='.' ){
 | 
					      }else if( zLeft && zLeft[0]=='.' && zLeft[1]=='.' ){
 | 
				
			||||||
        iEnd = strtol(&zLeft[2], 0, 0);
 | 
					        iEnd = strtol(&zLeft[2], 0, 0);
 | 
				
			||||||
      }else if( zLeft && zLeft[0]=='b' ){
 | 
					      }else if( zLeft && zLeft[0]=='b' ){
 | 
				
			||||||
        int ofst, nByte, hdrSize;
 | 
					        i64 ofst;
 | 
				
			||||||
 | 
					        int nByte, hdrSize;
 | 
				
			||||||
        unsigned char *a;
 | 
					        unsigned char *a;
 | 
				
			||||||
        if( iStart==1 ){
 | 
					        if( iStart==1 ){
 | 
				
			||||||
          hdrSize = 100;
 | 
					          hdrSize = 100;
 | 
				
			||||||
@@ -572,10 +573,10 @@ int main(int argc, char **argv){
 | 
				
			|||||||
          nByte = pagesize-100;
 | 
					          nByte = pagesize-100;
 | 
				
			||||||
        }else{
 | 
					        }else{
 | 
				
			||||||
          hdrSize = 0;
 | 
					          hdrSize = 0;
 | 
				
			||||||
          ofst = (iStart-1)*pagesize;
 | 
					          ofst = (i64)(iStart-1)*pagesize;
 | 
				
			||||||
          nByte = pagesize;
 | 
					          nByte = pagesize;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        ofst = 32 + hdrSize + (iStart-1)*(pagesize+24) + 24;
 | 
					        ofst = 32 + hdrSize + (i64)(iStart-1)*(pagesize+24) + 24;
 | 
				
			||||||
        a = getContent(ofst, nByte);
 | 
					        a = getContent(ofst, nByte);
 | 
				
			||||||
        decode_btree_page(a, iStart, hdrSize, zLeft+1);
 | 
					        decode_btree_page(a, iStart, hdrSize, zLeft+1);
 | 
				
			||||||
        free(a);
 | 
					        free(a);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user