]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a bug in the new checkpoint computation. Also update the checkpoint
authordrh <drh@noemail.net>
Wed, 19 May 2010 19:09:37 +0000 (19:09 +0000)
committerdrh <drh@noemail.net>
Wed, 19 May 2010 19:09:37 +0000 (19:09 +0000)
algorithm in the test scripts to align with the new implementation.

FossilOrigin-Name: 8b6056f2ee596f31b157a792fac05d11f7cb63bb

manifest
manifest.uuid
src/wal.c
test/wal.test

index df01a9717fb9580c524274e8a9b2a33c70c5fe84..b6ab9316e6aa46d2c6c6dd8351e3bea96d3f4dd1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Revise\sthe\schecksumming\salgorithm\sin\swal.c.\s\sMore\svariable\srefactoring.
-D 2010-05-19T18:08:11
+C Fix\sa\sbug\sin\sthe\snew\scheckpoint\scomputation.\s\sAlso\supdate\sthe\scheckpoint\nalgorithm\sin\sthe\stest\sscripts\sto\salign\swith\sthe\snew\simplementation.
+D 2010-05-19T19:09:38
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -227,7 +227,7 @@ F src/vdbeblob.c 5327132a42a91e8b7acfb60b9d2c3b1c5c863e0e
 F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1
 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2
 F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda
-F src/wal.c 5fd5853973652f8a8d81ab1ab7577559f46f3622
+F src/wal.c b77f0682a9345c4f4472539ba72829e709c5d8d6
 F src/wal.h 434f76f51225bb614e43ccb6bd2341541ba6a06e
 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
 F src/where.c 75fee9e255b62f773fcadd1d1f25b6f63ac7a356
@@ -764,7 +764,7 @@ F test/vtabE.test 7c4693638d7797ce2eda17af74292b97e705cc61
 F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
 F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
 F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d
-F test/wal.test 7a100918c45872fa19cfb4413299b9afb08727b6
+F test/wal.test 4724adbf440df45e31c572d9b740508a6f070da7
 F test/wal2.test 03059bc4d450c37f4b53278ddc3e2c7d53ac2d3f
 F test/walbak.test a0e45187c7d8928df035dfea29b99b016b21ca3c
 F test/walcrash.test f6d5fb2bb108876f04848720a488065d9deef69f
@@ -816,14 +816,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 1d201ff51f7c5ecdf71a91ed25204b7130894282
-R d0346b793d27da12b31b3a8952af1c86
+P 542b90eba6440a0bccef329788fd17a2d3fbeee6
+R 3eb344e252de7dd1dcb6df3f04c8046c
 U drh
-Z 747ef9a34e0e8619bf7584ee288d56f6
+Z d2ea1596a81ca8239241be44d26189c8
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFL9CkOoxKgR168RlERApEDAJ9DtZ/mpw6bX3TwJ7fVkL3EMPB9pACdF5w5
-cV3Imcsdjc3PNTWb9PaNKzw=
-=YSri
+iD8DBQFL9Dd1oxKgR168RlERAuuiAJ9n+tHe+QFxU832Z1mkHlHx1uXUYACgiZMB
+lhsmxWXcBlXcHZC8UqPgebk=
+=rNW0
 -----END PGP SIGNATURE-----
index d9a6bdd59ee3624f303edd3294c36716d791c1af..6449790d040933829042701cf2c799c37f0ba53a 100644 (file)
@@ -1 +1 @@
-542b90eba6440a0bccef329788fd17a2d3fbeee6
\ No newline at end of file
+8b6056f2ee596f31b157a792fac05d11f7cb63bb
\ No newline at end of file
index 1f90ce7267f0be2f17acf258ef4d8e7258488769..294d45a6f4b034e5bcf112294eb6862e2ef9cfbe 100644 (file)
--- a/src/wal.c
+++ b/src/wal.c
@@ -282,8 +282,8 @@ static void walChecksumBytes(u8 *a, int nByte, u32 *aCksum){
   assert( (nByte&0x00000003)==0 );
 
   do {
-    s1 += (a[0]<<24) + (a[2]<<16) + (a[2]<<8) + a[3] + s2;
-    s2 += (a[3]<<24) + (a[5]<<16) + (a[6]<<8) + a[7] + s1;
+    s1 += (a[0]<<24) + (a[1]<<16) + (a[2]<<8) + a[3] + s2;
+    s2 += (a[4]<<24) + (a[5]<<16) + (a[6]<<8) + a[7] + s1;
     a += 8;
   }while( a<aEnd );
   aCksum[0] = s1;
index fd40ad4fd05cd8c0a30a46377b65a48f21f4faf5..e3574da8efdea379d6f379270edd9230842cbc43 100644 (file)
@@ -1285,15 +1285,12 @@ proc logcksum {ckv1 ckv2 blob} {
   upvar $ckv1 c1
   upvar $ckv2 c2
 
-  binary scan $blob i* values
-  foreach v $values {
-    set v [expr {$v & 0xFFFFFFFF}]
-    incr c1 $v
-    incr c2 $c1
-  }
 
-  set c1 [expr ($c1 + ($c1>>24))&0xFFFFFFFF]
-  set c2 [expr ($c2 + ($c2>>24))&0xFFFFFFFF]
+  binary scan $blob I* values
+  foreach {v1 v2} $values {
+    set c1 [expr {($c1 + $v1 + $c2)&0xFFFFFFFF}]
+    set c2 [expr {($c2 + $v2 + $c1)&0xFFFFFFFF}]
+  }
 }
 
 file copy -force test.db testX.db
@@ -1308,7 +1305,7 @@ foreach {tn pgsz works} {
   8  16384    1
   9  32768    1
  10  65536    0
- 11   1020    0
+ 11   1016    0
 } {
 
   if {$::SQLITE_MAX_PAGE_SIZE < $pgsz} {
@@ -1479,4 +1476,3 @@ catch { db2 close }
 catch { db close }
 
 finish_test
-