aboutsummaryrefslogtreecommitdiff
path: root/tool/showwal.c
diff options
context:
space:
mode:
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;
}