1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix a bug in the new checkpoint computation. Also update the checkpoint

algorithm in the test scripts to align with the new implementation.

FossilOrigin-Name: 8b6056f2ee596f31b157a792fac05d11f7cb63bb
This commit is contained in:
drh
2010-05-19 19:09:37 +00:00
parent 584c754d65
commit 4c1cb6ab05
4 changed files with 19 additions and 23 deletions

View File

@@ -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-----

View File

@@ -1 +1 @@
542b90eba6440a0bccef329788fd17a2d3fbeee6
8b6056f2ee596f31b157a792fac05d11f7cb63bb

View File

@@ -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;

View 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