mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user