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.

FossilOrigin-Name: 90015df30655d884ecf7ae61e588824696954252dc6b1a5f78cf2de8cb236104
This commit is contained in:
drh 2017-04-16 22:41:49 +00:00
parent b65b3e429a
commit b6d5a43b8a
3 changed files with 16 additions and 7 deletions

View File

@ -1,5 +1,5 @@
C Add\sthe\sanycollseq.c\sloadable\sextension\sin\setc/misc C In\sthe\sshowwal\scommand-line\stool,\sfor\sunix\sbuilds,\sif\sthe\nauxiliary\sargument\sis\sof\nthe\sform\s"Ntruncate"\swhere\s"N"\sis\sa\sframe\snumber,\sthen\struncate\sthe\sWAL\nfile\safter\sthe\sN-th\sframe.
D 2017-04-16T22:08:31.808 D 2017-04-16T22:41:49.287
F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 6a8c838220f7c00820e1fc0ac1bccaaa8e5676067e1dbfa1bafa7a4ffecf8ae6 F Makefile.msc 6a8c838220f7c00820e1fc0ac1bccaaa8e5676067e1dbfa1bafa7a4ffecf8ae6
@ -1530,7 +1530,7 @@ F tool/showdb.c e6bc9dba233bf1b57ca0a525a2bba762db4e223de84990739db3f09c46151b1e
F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818 F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818
F tool/showlocks.c 9920bcc64f58378ff1118caead34147201f48c68 F tool/showlocks.c 9920bcc64f58378ff1118caead34147201f48c68
F tool/showstat4.c b14159aa062f661b394ba37b6b7b94bfb8012ab9 F tool/showstat4.c b14159aa062f661b394ba37b6b7b94bfb8012ab9
F tool/showwal.c ec79959834f7b21f1e0a2aa52bb7c056d2203977 F tool/showwal.c ad9d768f96ca6199ad3a8c9562d679680bd032dd01204ea3e5ea6fb931d81847
F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
F tool/spaceanal.tcl ab7d9bf68062907282a64b3e12ccbfad47193c5a F tool/spaceanal.tcl ab7d9bf68062907282a64b3e12ccbfad47193c5a
F tool/speed-check.sh 9630ba0468b609c52f48309243d4eb6e9c34deda F tool/speed-check.sh 9630ba0468b609c52f48309243d4eb6e9c34deda
@ -1573,7 +1573,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 89f9e4363aa19f306e55f749c442eae2f8994f6a47c65e645a79b308b450d5e5 P d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719
R 7e7a9c3544574aec28a263899284e68c R 8c1cbe1045ee7677fda3e059322e3580
U drh U drh
Z ee9d941ffe6bc63689ac0fdb0270a043 Z aa5715d42d381110f91b49a6f98fcf69

View File

@ -1 +1 @@
d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719 90015df30655d884ecf7ae61e588824696954252dc6b1a5f78cf2de8cb236104

View File

@ -12,6 +12,7 @@
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
#include <unistd.h> #include <unistd.h>
#include <sys/types.h>
#else #else
#include <io.h> #include <io.h>
#endif #endif
@ -579,6 +580,14 @@ int main(int argc, char **argv){
decode_btree_page(a, iStart, hdrSize, zLeft+1); decode_btree_page(a, iStart, hdrSize, zLeft+1);
free(a); free(a);
continue; 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{ }else{
iEnd = iStart; iEnd = iStart;
} }