diff options
author | drh <drh@noemail.net> | 2017-04-16 22:41:49 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2017-04-16 22:41:49 +0000 |
commit | b6d5a43b8a7afdbeb391f7ad5cea1e977a27e741 (patch) | |
tree | e8812e03159652ba00ae3b5277fbdc38722dc628 | |
parent | b65b3e429afce35f9bb99788391ca8bfbab339f6 (diff) | |
download | sqlite-b6d5a43b8a7afdbeb391f7ad5cea1e977a27e741.tar.gz sqlite-b6d5a43b8a7afdbeb391f7ad5cea1e977a27e741.zip |
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
-rw-r--r-- | manifest | 12 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | tool/showwal.c | 9 |
3 files changed, 16 insertions, 7 deletions
@@ -1,5 +1,5 @@ -C Add\sthe\sanycollseq.c\sloadable\sextension\sin\setc/misc -D 2017-04-16T22:08:31.808 +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:41:49.287 F Makefile.in 1cc758ce3374a32425e4d130c2fe7b026b20de5b8843243de75f087c0a2661fb F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 6a8c838220f7c00820e1fc0ac1bccaaa8e5676067e1dbfa1bafa7a4ffecf8ae6 @@ -1530,7 +1530,7 @@ F tool/showdb.c e6bc9dba233bf1b57ca0a525a2bba762db4e223de84990739db3f09c46151b1e F tool/showjournal.c 5bad7ae8784a43d2b270d953060423b8bd480818 F tool/showlocks.c 9920bcc64f58378ff1118caead34147201f48c68 F tool/showstat4.c b14159aa062f661b394ba37b6b7b94bfb8012ab9 -F tool/showwal.c ec79959834f7b21f1e0a2aa52bb7c056d2203977 +F tool/showwal.c ad9d768f96ca6199ad3a8c9562d679680bd032dd01204ea3e5ea6fb931d81847 F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe F tool/spaceanal.tcl ab7d9bf68062907282a64b3e12ccbfad47193c5a 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.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 89f9e4363aa19f306e55f749c442eae2f8994f6a47c65e645a79b308b450d5e5 -R 7e7a9c3544574aec28a263899284e68c +P d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719 +R 8c1cbe1045ee7677fda3e059322e3580 U drh -Z ee9d941ffe6bc63689ac0fdb0270a043 +Z aa5715d42d381110f91b49a6f98fcf69 diff --git a/manifest.uuid b/manifest.uuid index 380e05116..14a8d9cd9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719
\ No newline at end of file +90015df30655d884ecf7ae61e588824696954252dc6b1a5f78cf2de8cb236104
\ No newline at end of file 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; } |