OLD | NEW |
1 # 2010 December 1 | 1 # 2010 December 1 |
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 INSERT INTO ab VALUES(3, 4); | 186 INSERT INTO ab VALUES(3, 4); |
187 } db2 | 187 } db2 |
188 } {} | 188 } {} |
189 | 189 |
190 db eval {SELECT test4('3.3.2')} | 190 db eval {SELECT test4('3.3.2')} |
191 | 191 |
192 do_test 3.x { | 192 do_test 3.x { |
193 db2 close | 193 db2 close |
194 } {} | 194 } {} |
195 | 195 |
| 196 #------------------------------------------------------------------------- |
| 197 # Check that if a wal file has been partially checkpointed, no frames are |
| 198 # read from the checkpointed part. |
| 199 # |
| 200 reset_db |
| 201 do_execsql_test 4.1 { |
| 202 PRAGMA page_size = 1024; |
| 203 PRAGMA journal_mode = wal; |
| 204 CREATE TABLE t1(a, b); |
| 205 CREATE TABLE t2(a, b); |
| 206 PRAGMA wal_checkpoint = truncate; |
| 207 } {wal 0 0 0} |
| 208 |
| 209 do_test 4.2 { |
| 210 execsql { INSERT INTO t1 VALUES(1, 2) } |
| 211 file size test.db-wal |
| 212 } [wal_file_size 1 1024] |
| 213 |
| 214 do_test 4.3 { |
| 215 sqlite3 db2 test.db |
| 216 execsql { |
| 217 BEGIN; |
| 218 INSERT INTO t2 VALUES(3, 4); |
| 219 } |
| 220 execsql { PRAGMA wal_checkpoint = passive } db2 |
| 221 } {0 1 1} |
| 222 |
| 223 do_test 4.3 { |
| 224 execsql { COMMIT } |
| 225 db2 close |
| 226 hexio_write test.db-wal 0 [string repeat 00 2000] |
| 227 sqlite3 db2 test.db |
| 228 } {} |
| 229 |
| 230 do_test 4.4.1 { |
| 231 catchsql { SELECT * FROM t1 } db2 |
| 232 } {0 {1 2}} |
| 233 do_test 4.4.2 { |
| 234 catchsql { SELECT * FROM t2 } db2 |
| 235 } {1 {database disk image is malformed}} |
| 236 |
| 237 |
196 finish_test | 238 finish_test |
197 | 239 |
OLD | NEW |