SQLite

Check-in [90015df306]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the showwal command-line tool, for unix builds, if the auxiliary argument is of the form "Ntruncate" where "N" is a frame number, then truncate the WAL file after the N-th frame.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 90015df30655d884ecf7ae61e588824696954252dc6b1a5f78cf2de8cb236104
User & Date: drh 2017-04-16 22:41:49.287
Context
2017-04-17
13:18
Fix the ".column" output mode in the command-line shell so that it correctly counts and formats multi-byte UTF characters. (check-in: f508aff8d1 user: drh tags: trunk)
2017-04-16
22:41
In the showwal command-line tool, for unix builds, if the auxiliary argument is of the form "Ntruncate" where "N" is a frame number, then truncate the WAL file after the N-th frame. (check-in: 90015df306 user: drh tags: trunk)
22:08
Add the anycollseq.c loadable extension in etc/misc (check-in: d7b9813cb1 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to tool/showwal.c.
8
9
10
11
12
13
14

15
16
17
18
19
20
21
#include <fcntl.h>

#define ISDIGIT(X)  isdigit((unsigned char)(X))
#define ISPRINT(X)  isprint((unsigned char)(X))

#if !defined(_MSC_VER)
#include <unistd.h>

#else
#include <io.h>
#endif

#include <stdlib.h>
#include <string.h>








>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <fcntl.h>

#define ISDIGIT(X)  isdigit((unsigned char)(X))
#define ISPRINT(X)  isprint((unsigned char)(X))

#if !defined(_MSC_VER)
#include <unistd.h>
#include <sys/types.h>
#else
#include <io.h>
#endif

#include <stdlib.h>
#include <string.h>

575
576
577
578
579
580
581








582
583
584
585
586
587
588
          nByte = pagesize;
        }
        ofst = 32 + hdrSize + (iStart-1)*(pagesize+24) + 24;
        a = getContent(ofst, nByte);
        decode_btree_page(a, iStart, hdrSize, zLeft+1);
        free(a);
        continue;








      }else{
        iEnd = iStart;
      }
      if( iStart<1 || iEnd<iStart || iEnd>mxFrame ){
        fprintf(stderr,
          "Page argument should be LOWER?..UPPER?.  Range 1 to %d\n",
          mxFrame);







>
>
>
>
>
>
>
>







576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
          nByte = pagesize;
        }
        ofst = 32 + hdrSize + (iStart-1)*(pagesize+24) + 24;
        a = getContent(ofst, nByte);
        decode_btree_page(a, iStart, hdrSize, zLeft+1);
        free(a);
        continue;
#if !defined(_MSC_VER)
      }else if( zLeft && strcmp(zLeft,"truncate")==0 ){
        /* Frame number followed by "truncate" truncates the WAL file
        ** after that frame */
        off_t newSize = 32 + iStart*(pagesize+24);
        truncate(argv[1], newSize);
        continue;
#endif
      }else{
        iEnd = iStart;
      }
      if( iStart<1 || iEnd<iStart || iEnd>mxFrame ){
        fprintf(stderr,
          "Page argument should be LOWER?..UPPER?.  Range 1 to %d\n",
          mxFrame);