| OLD | NEW |
| 1 # 2007 May 04 | 1 # 2007 May 04 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 INSERT INTO t1 SELECT * FROM t1; -- 4096 | 181 INSERT INTO t1 SELECT * FROM t1; -- 4096 |
| 182 INSERT INTO t1 SELECT * FROM t1; -- 8192 | 182 INSERT INTO t1 SELECT * FROM t1; -- 8192 |
| 183 DELETE FROM t1 WHERE oid>512; | 183 DELETE FROM t1 WHERE oid>512; |
| 184 DELETE FROM t1; | 184 DELETE FROM t1; |
| 185 } | 185 } |
| 186 | 186 |
| 187 do_test 4.2 { | 187 do_test 4.2 { |
| 188 execsql { | 188 execsql { |
| 189 PRAGMA journal_mode = WAL; | 189 PRAGMA journal_mode = WAL; |
| 190 PRAGMA incremental_vacuum(1); | 190 PRAGMA incremental_vacuum(1); |
| 191 PRAGMA wal_checkpoint; | |
| 192 } | 191 } |
| 192 } {wal} |
| 193 do_test 4.2.1 { |
| 194 execsql { PRAGMA wal_checkpoint } |
| 193 file size test.db-wal | 195 file size test.db-wal |
| 194 } [expr {32+2*(512+24)}] | 196 } [expr {32+2*(512+24)}] |
| 195 | 197 |
| 196 do_test 4.3 { | 198 do_test 4.3 { |
| 197 db close | 199 db close |
| 198 sqlite3 db test.db | 200 sqlite3 db test.db |
| 199 set maxsz 0 | 201 set maxsz 0 |
| 200 while {[file size test.db] > [expr 512*3]} { | 202 while {[file size test.db] > [expr 512*3]} { |
| 201 execsql { PRAGMA journal_mode = WAL } | 203 execsql { PRAGMA journal_mode = WAL } |
| 202 execsql { PRAGMA wal_checkpoint } | 204 execsql { PRAGMA wal_checkpoint } |
| 203 execsql { PRAGMA incremental_vacuum(1) } | 205 execsql { PRAGMA incremental_vacuum(1) } |
| 204 set newsz [file size test.db-wal] | 206 set newsz [file size test.db-wal] |
| 205 if {$newsz>$maxsz} {set maxsz $newsz} | 207 if {$newsz>$maxsz} {set maxsz $newsz} |
| 206 } | 208 } |
| 207 set maxsz | 209 set maxsz |
| 208 } [expr {32+3*(512+24)}] | 210 } [expr {32+3*(512+24)}] |
| 209 } | 211 } |
| 210 | 212 |
| 211 finish_test | 213 finish_test |
| OLD | NEW |