| OLD | NEW |
| 1 # 2007 August 23 | 1 # 2007 August 23 |
| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 {INSERT INTO abc VALUES(4, 5, 6)} {1 2 3 4 5 6} \ | 66 {INSERT INTO abc VALUES(4, 5, 6)} {1 2 3 4 5 6} \ |
| 67 {DELETE FROM abc} {} \ | 67 {DELETE FROM abc} {} \ |
| 68 {INSERT INTO abc SELECT * FROM abc} {1 2 3 1 2 3} \ | 68 {INSERT INTO abc SELECT * FROM abc} {1 2 3 1 2 3} \ |
| 69 {UPDATE abc SET a = 2} {2 2 3} \ | 69 {UPDATE abc SET a = 2} {2 2 3} \ |
| 70 {INSERT INTO abc VALUES(4, 5, randstr(1000,1000))} {n/a} \ | 70 {INSERT INTO abc VALUES(4, 5, randstr(1000,1000))} {n/a} \ |
| 71 {CREATE TABLE def(d, e, f)} {n/a} \ | 71 {CREATE TABLE def(d, e, f)} {n/a} \ |
| 72 ] { | 72 ] { |
| 73 for {set ii 0} {$ii < 10} {incr ii} { | 73 for {set ii 0} {$ii < 10} {incr ii} { |
| 74 | 74 |
| 75 db close | 75 db close |
| 76 file delete -force test.db test.db-journal | 76 forcedelete test.db test.db-journal |
| 77 sqlite3 db test.db | 77 sqlite3 db test.db |
| 78 do_test crash3-1.$tn.1 { | 78 do_test crash3-1.$tn.1 { |
| 79 execsql { | 79 execsql { |
| 80 PRAGMA page_size = 1024; | 80 PRAGMA page_size = 1024; |
| 81 BEGIN; | 81 BEGIN; |
| 82 CREATE TABLE abc(a, b, c); | 82 CREATE TABLE abc(a, b, c); |
| 83 INSERT INTO abc VALUES(1, 2, 3); | 83 INSERT INTO abc VALUES(1, 2, 3); |
| 84 COMMIT; | 84 COMMIT; |
| 85 } | 85 } |
| 86 } {} | 86 } {} |
| (...skipping 12 matching lines...) Expand all Loading... |
| 99 execsql { SELECT * FROM abc } | 99 execsql { SELECT * FROM abc } |
| 100 } {1 2 3} $res2 | 100 } {1 2 3} $res2 |
| 101 | 101 |
| 102 incr tn | 102 incr tn |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 # This block tests both the IOCAP_SEQUENTIAL and IOCAP_SAFE_APPEND flags. | 106 # This block tests both the IOCAP_SEQUENTIAL and IOCAP_SAFE_APPEND flags. |
| 107 # | 107 # |
| 108 db close | 108 db close |
| 109 file delete -force test.db test.db-journal | 109 forcedelete test.db test.db-journal |
| 110 sqlite3 db test.db | 110 sqlite3 db test.db |
| 111 do_test crash3-2.0 { | 111 do_test crash3-2.0 { |
| 112 execsql { | 112 execsql { |
| 113 BEGIN; | 113 BEGIN; |
| 114 CREATE TABLE abc(a PRIMARY KEY, b, c); | 114 CREATE TABLE abc(a PRIMARY KEY, b, c); |
| 115 CREATE TABLE def(d PRIMARY KEY, e, f); | 115 CREATE TABLE def(d PRIMARY KEY, e, f); |
| 116 PRAGMA default_cache_size = 10; | 116 PRAGMA default_cache_size = 10; |
| 117 INSERT INTO abc VALUES(randstr(10,1000),randstr(10,1000),randstr(10,1000)); | 117 INSERT INTO abc VALUES(randstr(10,1000),randstr(10,1000),randstr(10,1000)); |
| 118 INSERT INTO abc | 118 INSERT INTO abc |
| 119 SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; | 119 SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 # The following block tests an interaction between IOCAP_ATOMIC and | 172 # The following block tests an interaction between IOCAP_ATOMIC and |
| 173 # IOCAP_SEQUENTIAL. At one point, if both flags were set, small | 173 # IOCAP_SEQUENTIAL. At one point, if both flags were set, small |
| 174 # journal files that contained only a single page, but were required | 174 # journal files that contained only a single page, but were required |
| 175 # for some other reason (i.e. nTrunk) were not being written to | 175 # for some other reason (i.e. nTrunk) were not being written to |
| 176 # disk. | 176 # disk. |
| 177 # | 177 # |
| 178 for {set ii 0} {$ii < 10} {incr ii} { | 178 for {set ii 0} {$ii < 10} {incr ii} { |
| 179 db close | 179 db close |
| 180 file delete -force test.db test.db-journal | 180 forcedelete test.db test.db-journal |
| 181 crashsql -file test.db -char {sequential atomic} { | 181 crashsql -file test.db -char {sequential atomic} { |
| 182 CREATE TABLE abc(a, b, c); | 182 CREATE TABLE abc(a, b, c); |
| 183 } | 183 } |
| 184 sqlite3 db test.db | 184 sqlite3 db test.db |
| 185 do_test crash3-3.$ii { | 185 do_test crash3-3.$ii { |
| 186 execsql {PRAGMA integrity_check} | 186 execsql {PRAGMA integrity_check} |
| 187 } {ok} | 187 } {ok} |
| 188 } | 188 } |
| 189 | 189 |
| 190 finish_test | 190 finish_test |
| OLD | NEW |