/ Check-in [34212aa8]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Another fix to the hash signature algorithm in vfslog.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 34212aa8c405c4ff3f8045ec0cf2a860af61540f
User & Date: drh 2013-10-10 13:41:04
Context
2013-10-10
15:04
Enhancements to the vfslog.c module to show all change-counter changes and to show the hostname and pid of the process that creates each log file. check-in: af7abebe user: drh tags: trunk
13:41
Another fix to the hash signature algorithm in vfslog.c. check-in: 34212aa8 user: drh tags: trunk
13:38
Fix the hash signature algorithm in vfslog.c. Add a utility program to show the hash signatures for every page of a database file. check-in: eaf4de13 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to ext/misc/vfslog.c.

323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
    pI = (unsigned int*)p;
    for(i=0; i<n-7; i+=8){
      s0 += pI[0] + s1;
      s1 += pI[1] + s0;
      pI += 2;
    }
    for(i=0; i<8; i++) sqlite3_snprintf(3, zCksum+i*2, "%02x", p[i]);
    sqlite3_snprintf(18, zCksum+i*2, "-%08x08x", s0, s1);
  }
}

/*
** Read data from an vlog-file.
*/
static int vlogRead(







|







323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
    pI = (unsigned int*)p;
    for(i=0; i<n-7; i+=8){
      s0 += pI[0] + s1;
      s1 += pI[1] + s0;
      pI += 2;
    }
    for(i=0; i<8; i++) sqlite3_snprintf(3, zCksum+i*2, "%02x", p[i]);
    sqlite3_snprintf(18, zCksum+i*2, "-%08x%08x", s0, s1);
  }
}

/*
** Read data from an vlog-file.
*/
static int vlogRead(

Changes to tool/pagesig.c.

38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    pI = (unsigned int*)p;
    for(i=0; i<n-7; i+=8){
      s0 += pI[0] + s1;
      s1 += pI[1] + s0;
      pI += 2;
    }
    for(i=0; i<8; i++) sprintf(zCksum+i*2, "%02x", p[i]);
    sprintf(zCksum+i*2, "-%08x08x", s0, s1);
  }
}

/*
** Open a file.  Find its page size.  Read each page, and compute and
** display the page signature.
*/







|







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    pI = (unsigned int*)p;
    for(i=0; i<n-7; i+=8){
      s0 += pI[0] + s1;
      s1 += pI[1] + s0;
      pI += 2;
    }
    for(i=0; i<8; i++) sprintf(zCksum+i*2, "%02x", p[i]);
    sprintf(zCksum+i*2, "-%08x%08x", s0, s1);
  }
}

/*
** Open a file.  Find its page size.  Read each page, and compute and
** display the page signature.
*/