aboutsummaryrefslogtreecommitdiff
path: root/tool/showwal.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2017-04-20 17:35:46 +0000
committerdan <dan@noemail.net>2017-04-20 17:35:46 +0000
commitc42a0056d7817f629d78de5d285e2df189ceb10e (patch)
tree80269bfa40a3837a9b99fe062257f9779217df4a /tool/showwal.c
parentac33c0343f54bca37411b9f4b11115f7a583b241 (diff)
parentdc62daca866006c4afa4c32c405d1a327dc7334f (diff)
downloadsqlite-c42a0056d7817f629d78de5d285e2df189ceb10e.tar.gz
sqlite-c42a0056d7817f629d78de5d285e2df189ceb10e.zip
Merge latest trunk changes into this branch.
FossilOrigin-Name: b1533bc455f52f570c0f4b8aaa0da802757dc89b0e45b9a9b31aa591a44bf7bd
Diffstat (limited to 'tool/showwal.c')
-rw-r--r--tool/showwal.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tool/showwal.c b/tool/showwal.c
index 33cc21896..b214a288e 100644
--- a/tool/showwal.c
+++ b/tool/showwal.c
@@ -12,6 +12,7 @@
#if !defined(_MSC_VER)
#include <unistd.h>
+#include <sys/types.h>
#else
#include <io.h>
#endif
@@ -579,6 +580,14 @@ int main(int argc, char **argv){
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;
}