1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

VACUUM works even on an empty database. Ticket #1512. (CVS 2760)

FossilOrigin-Name: 1b6bf4188e8ebf55cf1972b7081f6d31bf525555
This commit is contained in:
drh
2005-11-04 22:03:30 +00:00
parent c01be744bc
commit c9ac5caa45
9 changed files with 115 additions and 38 deletions

View File

@ -13,6 +13,7 @@
static int pagesize = 1024;
static int db = -1;
static int mxPage = 0;
static int perLine = 32;
static void out_of_memory(void){
fprintf(stderr,"Out of memory...\n");
@ -27,12 +28,12 @@ static print_page(int iPg){
lseek(db, (iPg-1)*pagesize, SEEK_SET);
read(db, aData, pagesize);
fprintf(stdout, "Page %d:\n", iPg);
for(i=0; i<pagesize; i += 16){
for(i=0; i<pagesize; i += perLine){
fprintf(stdout, " %03x: ",i);
for(j=0; j<16; j++){
for(j=0; j<perLine; j++){
fprintf(stdout,"%02x ", aData[i+j]);
}
for(j=0; j<16; j++){
for(j=0; j<perLine; j++){
fprintf(stdout,"%c", isprint(aData[i+j]) ? aData[i+j] : '.');
}
fprintf(stdout,"\n");