| Index: third_party/sqlite/src/test/wal5.test | 
| diff --git a/third_party/sqlite/src/test/wal5.test b/third_party/sqlite/src/test/wal5.test | 
| index ad6bcfc7d83844f1341db75e5ff78cb8912087ff..68750f1479d8eb4061a9ead52a6a28c580233103 100644 | 
| --- a/third_party/sqlite/src/test/wal5.test | 
| +++ b/third_party/sqlite/src/test/wal5.test | 
| @@ -197,9 +197,9 @@ foreach {testprefix do_wal_checkpoint} { | 
| INSERT INTO t2 VALUES(1, 2); | 
| } | 
| } {} | 
| -    do_test 2.2.$tn.2 { file_page_counts } {1 5 1 5} | 
| -    do_test 2.1.$tn.3 { code1 { do_wal_checkpoint db } } {0 5 5} | 
| -    do_test 2.1.$tn.4 { file_page_counts } {2 5 2 5} | 
| +    do_test 2.2.$tn.2 { file_page_counts } {1 3 1 3} | 
| +    do_test 2.1.$tn.3 { code1 { do_wal_checkpoint db } } {0 3 3} | 
| +    do_test 2.1.$tn.4 { file_page_counts } {2 3 2 3} | 
| } | 
|  | 
| do_multiclient_test tn { | 
| @@ -213,10 +213,10 @@ foreach {testprefix do_wal_checkpoint} { | 
| INSERT INTO t2 VALUES(3, 4); | 
| } | 
| } {} | 
| -    do_test 2.2.$tn.2 { file_page_counts } {1 5 1 7} | 
| +    do_test 2.2.$tn.2 { file_page_counts } {1 3 1 4} | 
| do_test 2.2.$tn.3 { sql2 { BEGIN; SELECT * FROM t1 } } {1 2} | 
| -    do_test 2.2.$tn.4 { code1 { do_wal_checkpoint db -mode restart } } {1 5 5} | 
| -    do_test 2.2.$tn.5 { file_page_counts } {2 5 2 7} | 
| +    do_test 2.2.$tn.4 { code1 { do_wal_checkpoint db -mode restart } } {1 3 3} | 
| +    do_test 2.2.$tn.5 { file_page_counts } {2 3 2 4} | 
| } | 
|  | 
| do_multiclient_test tn { | 
| @@ -229,13 +229,22 @@ foreach {testprefix do_wal_checkpoint} { | 
| INSERT INTO t2 VALUES(1, 2); | 
| } | 
| } {} | 
| -    do_test 2.3.$tn.2 { file_page_counts } {1 5 1 5} | 
| +    do_test 2.3.$tn.2 { file_page_counts } {1 3 1 3} | 
| do_test 2.3.$tn.3 { sql2 { BEGIN; SELECT * FROM t1 } } {1 2} | 
| do_test 2.3.$tn.4 { sql1 { INSERT INTO t1 VALUES(3, 4) } } {} | 
| do_test 2.3.$tn.5 { sql1 { INSERT INTO t2 VALUES(3, 4) } } {} | 
| -    do_test 2.3.$tn.6 { file_page_counts } {1 7 1 7} | 
| -    do_test 2.3.$tn.7 { code1 { do_wal_checkpoint db -mode full } } {1 7 5} | 
| -    do_test 2.3.$tn.8 { file_page_counts } {1 7 2 7} | 
| +    do_test 2.3.$tn.6 { file_page_counts } {1 4 1 4} | 
| +    do_test 2.3.$tn.7 { code1 { do_wal_checkpoint db -mode full } } {1 4 3} | 
| + | 
| +    # The checkpoint above only writes page 1 of the db file. The other | 
| +    # page (page 2) is locked by the read-transaction opened by the | 
| +    # [sql2] commmand above. So normally, the db is 1 page in size here. | 
| +    # However, in mmap() mode, the db is pre-allocated to 2 pages at the | 
| +    # start of the checkpoint, even though page 2 cannot be written. | 
| +    set nDb 2 | 
| +    if {[permutation]!="mmap"} {set nDb 1} | 
| +    ifcapable !mmap {set nDb 1} | 
| +    do_test 2.3.$tn.8 { file_page_counts } [list $nDb 4 2 4] | 
| } | 
|  | 
| # Check that checkpoints block on the correct locks. And respond correctly | 
| @@ -256,18 +265,18 @@ foreach {testprefix do_wal_checkpoint} { | 
| # processes holding all three types of locks. | 
| # | 
| foreach {tn1 checkpoint busy_on ckpt_expected expected} { | 
| -    1   PASSIVE   -   {0 5 5}   - | 
| -    2   TYPO      -   {0 5 5}   - | 
| +    1   PASSIVE   -   {0 3 3}   - | 
| +    2   TYPO      -   {0 3 3}   - | 
|  | 
| -    3   FULL      -   {0 7 7}   2 | 
| -    4   FULL      1   {1 5 5}   1 | 
| -    5   FULL      2   {1 7 5}   2 | 
| -    6   FULL      3   {0 7 7}   2 | 
| +    3   FULL      -   {0 4 4}   2 | 
| +    4   FULL      1   {1 3 3}   1 | 
| +    5   FULL      2   {1 4 3}   2 | 
| +    6   FULL      3   {0 4 4}   2 | 
|  | 
| -    7   RESTART   -   {0 7 7}   3 | 
| -    8   RESTART   1   {1 5 5}   1 | 
| -    9   RESTART   2   {1 7 5}   2 | 
| -    10  RESTART   3   {1 7 7}   3 | 
| +    7   RESTART   -   {0 4 4}   3 | 
| +    8   RESTART   1   {1 3 3}   1 | 
| +    9   RESTART   2   {1 4 3}   2 | 
| +    10  RESTART   3   {1 4 4}   3 | 
|  | 
| } { | 
| do_multiclient_test tn { | 
| @@ -343,4 +352,3 @@ foreach {testprefix do_wal_checkpoint} { | 
|  | 
|  | 
| finish_test | 
| - | 
|  |