OLD | NEW |
1 # 2007 March 24 | 1 # 2007 March 24 |
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 # | 114 # |
115 # For similar reasons, this test does not work with the memsubsys1 permutation. | 115 # For similar reasons, this test does not work with the memsubsys1 permutation. |
116 # Permutation memsubsys1 configures the pcache subsystem to use a static | 116 # Permutation memsubsys1 configures the pcache subsystem to use a static |
117 # allocation of 24 pages (shared between all pagers). This is not enough for | 117 # allocation of 24 pages (shared between all pagers). This is not enough for |
118 # this test. | 118 # this test. |
119 # | 119 # |
120 do_test exclusive2-1.1 { | 120 do_test exclusive2-1.1 { |
121 execsql { | 121 execsql { |
122 BEGIN; | 122 BEGIN; |
123 CREATE TABLE t1(a, b); | 123 CREATE TABLE t1(a, b); |
124 INSERT INTO t1(a) VALUES(randstr(10, 400)); | 124 INSERT INTO t1(a, b) VALUES(randstr(10, 400), 0); |
125 INSERT INTO t1(a) VALUES(randstr(10, 400)); | 125 INSERT INTO t1(a, b) VALUES(randstr(10, 400), 0); |
126 INSERT INTO t1(a) SELECT randstr(10, 400) FROM t1; | 126 INSERT INTO t1(a, b) SELECT randstr(10, 400), 0 FROM t1; |
127 INSERT INTO t1(a) SELECT randstr(10, 400) FROM t1; | 127 INSERT INTO t1(a, b) SELECT randstr(10, 400), 0 FROM t1; |
128 INSERT INTO t1(a) SELECT randstr(10, 400) FROM t1; | 128 INSERT INTO t1(a, b) SELECT randstr(10, 400), 0 FROM t1; |
129 INSERT INTO t1(a) SELECT randstr(10, 400) FROM t1; | 129 INSERT INTO t1(a, b) SELECT randstr(10, 400), 0 FROM t1; |
130 INSERT INTO t1(a) SELECT randstr(10, 400) FROM t1; | 130 INSERT INTO t1(a, b) SELECT randstr(10, 400), 0 FROM t1; |
131 COMMIT; | 131 COMMIT; |
132 SELECT count(*) FROM t1; | 132 SELECT count(*) FROM t1; |
133 } | 133 } |
134 } {64} | 134 } {64} |
135 do_test exclusive2-1.2.1 { | 135 do_test exclusive2-1.2.1 { |
136 # Make sure the pager cache is large enough to store the | 136 # Make sure the pager cache is large enough to store the |
137 # entire database. | 137 # entire database. |
138 set nPage [expr [file size test.db]/1024] | 138 set nPage [expr [file size test.db]/1024] |
139 if {$::SQLITE_DEFAULT_CACHE_SIZE < $nPage} { | 139 if {$::SQLITE_DEFAULT_CACHE_SIZE < $nPage} { |
140 execsql "PRAGMA cache_size = $nPage" | 140 execsql "PRAGMA cache_size = $nPage" |
141 } | 141 } |
142 expr {[execsql {PRAGMA cache_size}] >= $nPage} | 142 expr {[execsql {PRAGMA cache_size}] >= $nPage} |
143 } {1} | 143 } {1} |
144 do_test exclusive2-1.2 { | 144 do_test exclusive2-1.2 { |
145 set ::sig [t1sig] | 145 set ::sig [t1sig] |
146 readPagerChangeCounter test.db | 146 readPagerChangeCounter test.db |
147 } {1} | 147 } {1} |
148 do_test exclusive2-1.3 { | 148 do_test exclusive2-1.3 { |
149 t1sig | 149 t1sig |
150 } $::sig | 150 } $::sig |
151 do_test exclusive2-1.4 { | 151 do_test exclusive2-1.4 { |
152 sqlite3 db2 test.db | 152 sqlite3 db2 test.db |
153 t1sig db2 | 153 t1sig db2 |
154 } $::sig | 154 } $::sig |
155 do_test exclusive2-1.5 { | 155 do_test exclusive2-1.5 { |
156 execsql { | 156 execsql { |
157 UPDATE t1 SET b=a, a=NULL; | 157 UPDATE t1 SET b=a, a=0; |
158 } db2 | 158 } db2 |
159 expr {[t1sig db2] eq $::sig} | 159 expr {[t1sig db2] eq $::sig} |
160 } 0 | 160 } 0 |
161 do_test exclusive2-1.6 { | 161 do_test exclusive2-1.6 { |
162 readPagerChangeCounter test.db | 162 readPagerChangeCounter test.db |
163 } {2} | 163 } {2} |
164 do_test exclusive2-1.7 { | 164 do_test exclusive2-1.7 { |
165 pagerChangeCounter test.db 1 | 165 pagerChangeCounter test.db 1 |
166 } {1} | 166 } {1} |
167 if {[permutation] != "memsubsys1"} { | 167 if {[permutation] != "memsubsys1"} { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } {4} | 315 } {4} |
316 do_test exclusive2-3.6 { | 316 do_test exclusive2-3.6 { |
317 execsql { | 317 execsql { |
318 INSERT INTO t1 VALUES(randstr(200, 200)); | 318 INSERT INTO t1 VALUES(randstr(200, 200)); |
319 } | 319 } |
320 readPagerChangeCounter test.db | 320 readPagerChangeCounter test.db |
321 } {5} | 321 } {5} |
322 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) | 322 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) |
323 | 323 |
324 finish_test | 324 finish_test |
OLD | NEW |