Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: third_party/sqlite/src/test/wal6.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/wal5.test ('k') | third_party/sqlite/src/test/walblock.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/wal5.test ('k') | third_party/sqlite/src/test/walblock.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698