| OLD | NEW |
| 1 # 2001 October 12 | 1 # 2001 October 12 |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 CREATE TABLE abc(a); | 68 CREATE TABLE abc(a); |
| 69 CREATE TABLE abc2(b); | 69 CREATE TABLE abc2(b); |
| 70 } -sqlbody { | 70 } -sqlbody { |
| 71 BEGIN; | 71 BEGIN; |
| 72 INSERT INTO abc2 VALUES(10); | 72 INSERT INTO abc2 VALUES(10); |
| 73 DROP TABLE abc; | 73 DROP TABLE abc; |
| 74 COMMIT; | 74 COMMIT; |
| 75 DROP TABLE abc2; | 75 DROP TABLE abc2; |
| 76 } | 76 } |
| 77 | 77 |
| 78 file delete -force backup.db | 78 forcedelete backup.db |
| 79 ifcapable subquery { | 79 ifcapable subquery { |
| 80 do_ioerr_test autovacuum-ioerr2-4 -tclprep { | 80 do_ioerr_test autovacuum-ioerr2-4 -tclprep { |
| 81 if {![file exists backup.db]} { | 81 if {![file exists backup.db]} { |
| 82 sqlite3 dbb backup.db | 82 sqlite3 dbb backup.db |
| 83 execsql { | 83 execsql { |
| 84 PRAGMA auto_vacuum = 1; | 84 PRAGMA auto_vacuum = 1; |
| 85 BEGIN; | 85 BEGIN; |
| 86 CREATE TABLE abc(a); | 86 CREATE TABLE abc(a); |
| 87 INSERT INTO abc VALUES(randstr(1100,1100)); -- Page 4 is overflow | 87 INSERT INTO abc VALUES(randstr(1100,1100)); -- Page 4 is overflow |
| 88 INSERT INTO abc VALUES(randstr(1100,1100)); -- Page 5 is overflow | 88 INSERT INTO abc VALUES(randstr(1100,1100)); -- Page 5 is overflow |
| 89 } dbb | 89 } dbb |
| 90 for {set i 0} {$i<2500} {incr i} { | 90 for {set i 0} {$i<2500} {incr i} { |
| 91 execsql { | 91 execsql { |
| 92 INSERT INTO abc VALUES(randstr(100,100)); | 92 INSERT INTO abc VALUES(randstr(100,100)); |
| 93 } dbb | 93 } dbb |
| 94 } | 94 } |
| 95 execsql { | 95 execsql { |
| 96 COMMIT; | 96 COMMIT; |
| 97 PRAGMA cache_size = 10; | 97 PRAGMA cache_size = 10; |
| 98 } dbb | 98 } dbb |
| 99 dbb close | 99 dbb close |
| 100 } | 100 } |
| 101 db close | 101 db close |
| 102 file delete -force test.db | 102 forcedelete test.db |
| 103 file delete -force test.db-journal | 103 forcedelete test.db-journal |
| 104 copy_file backup.db test.db | 104 forcecopy backup.db test.db |
| 105 set ::DB [sqlite3 db test.db] | 105 set ::DB [sqlite3 db test.db] |
| 106 execsql { | 106 execsql { |
| 107 PRAGMA cache_size = 10; | 107 PRAGMA cache_size = 10; |
| 108 } | 108 } |
| 109 } -sqlbody { | 109 } -sqlbody { |
| 110 BEGIN; | 110 BEGIN; |
| 111 DELETE FROM abc WHERE oid < 3; | 111 DELETE FROM abc WHERE oid < 3; |
| 112 UPDATE abc SET a = randstr(100,100) WHERE oid > 2300; | 112 UPDATE abc SET a = randstr(100,100) WHERE oid > 2300; |
| 113 UPDATE abc SET a = randstr(1100,1100) WHERE oid = | 113 UPDATE abc SET a = randstr(1100,1100) WHERE oid = |
| 114 (select max(oid) from abc); | 114 (select max(oid) from abc); |
| 115 COMMIT; | 115 COMMIT; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 do_ioerr_test autovacuum-ioerr2-1 -sqlprep { | 119 do_ioerr_test autovacuum-ioerr2-1 -sqlprep { |
| 120 PRAGMA auto_vacuum = 1; | 120 PRAGMA auto_vacuum = 1; |
| 121 CREATE TABLE abc(a); | 121 CREATE TABLE abc(a); |
| 122 INSERT INTO abc VALUES(randstr(1500,1500)); | 122 INSERT INTO abc VALUES(randstr(1500,1500)); |
| 123 } -sqlbody { | 123 } -sqlbody { |
| 124 CREATE TABLE abc2(a); | 124 CREATE TABLE abc2(a); |
| 125 BEGIN; | 125 BEGIN; |
| 126 DELETE FROM abc; | 126 DELETE FROM abc; |
| 127 INSERT INTO abc VALUES(randstr(1500,1500)); | 127 INSERT INTO abc VALUES(randstr(1500,1500)); |
| 128 CREATE TABLE abc3(a); | 128 CREATE TABLE abc3(a); |
| 129 COMMIT; | 129 COMMIT; |
| 130 } | 130 } |
| 131 | 131 |
| 132 finish_test | 132 finish_test |
| OLD | NEW |