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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test/savepoint2.test ('k') | third_party/sqlite/src/test/schema.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 # 2009 January 3 1 # 2009 January 3
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 #***********************************************************************
11 # 11 #
12 # $Id: savepoint6.test,v 1.4 2009/06/05 17:09:12 drh Exp $ 12 # $Id: savepoint6.test,v 1.4 2009/06/05 17:09:12 drh Exp $
13 13
14 set testdir [file dirname $argv0] 14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl 15 source $testdir/tester.tcl
16 16
17 proc sql {zSql} { 17 proc sql {zSql} {
18 uplevel db eval [list $zSql] 18 uplevel db eval [list $zSql]
19 #puts stderr "$zSql ;" 19 #puts stderr "$zSql ;"
20 } 20 }
21 21
22 set DATABASE_SCHEMA { 22 set DATABASE_SCHEMA {
23 PRAGMA auto_vacuum = incremental; 23 PRAGMA auto_vacuum = incremental;
24 CREATE TABLE t1(x, y); 24 CREATE TABLE t1(x, y);
25 CREATE UNIQUE INDEX i1 ON t1(x); 25 CREATE UNIQUE INDEX i1 ON t1(x);
26 CREATE INDEX i2 ON t1(y); 26 CREATE INDEX i2 ON t1(y);
27 } 27 }
28 28
29 if {0==[info exists ::G(savepoint6_iterations)]} {
30 set ::G(savepoint6_iterations) 1000
31 }
32
29 #-------------------------------------------------------------------------- 33 #--------------------------------------------------------------------------
30 # In memory database state. 34 # In memory database state.
31 # 35 #
32 # ::lSavepoint is a list containing one entry for each active savepoint. The 36 # ::lSavepoint is a list containing one entry for each active savepoint. The
33 # first entry in the list corresponds to the most recently opened savepoint. 37 # first entry in the list corresponds to the most recently opened savepoint.
34 # Each entry consists of two elements: 38 # Each entry consists of two elements:
35 # 39 #
36 # 1. The savepoint name. 40 # 1. The savepoint name.
37 # 41 #
38 # 2. A serialized Tcl array representing the contents of table t1 at the 42 # 2. A serialized Tcl array representing the contents of table t1 at the
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 rollback two 219 rollback two
216 release one 220 release one
217 221
218 execsql {SELECT count(*) FROM t1} 222 execsql {SELECT count(*) FROM t1}
219 } {44} 223 } {44}
220 224
221 foreach zSetup [list { 225 foreach zSetup [list {
222 set testname normal 226 set testname normal
223 sqlite3 db test.db 227 sqlite3 db test.db
224 } { 228 } {
229 if {[wal_is_wal_mode]} continue
225 set testname tempdb 230 set testname tempdb
226 sqlite3 db "" 231 sqlite3 db ""
227 } { 232 } {
228 if {[catch {set ::permutations_test_prefix} z] == 0 && $z eq "journaltest"} { 233 if {[permutation] eq "journaltest"} {
229 continue 234 continue
230 } 235 }
231 set testname nosync 236 set testname nosync
232 sqlite3 db test.db 237 sqlite3 db test.db
233 sql { PRAGMA synchronous = off } 238 sql { PRAGMA synchronous = off }
234 } { 239 } {
235 set testname smallcache 240 set testname smallcache
236 sqlite3 db test.db 241 sqlite3 db test.db
237 sql { PRAGMA cache_size = 10 } 242 sql { PRAGMA cache_size = 10 }
238 }] { 243 }] {
239 244
240 unset -nocomplain ::lSavepoint 245 unset -nocomplain ::lSavepoint
241 unset -nocomplain ::aEntry 246 unset -nocomplain ::aEntry
242 247
243 catch { db close } 248 catch { db close }
244 file delete -force test.db 249 file delete -force test.db test.db-wal test.db-journal
245 eval $zSetup 250 eval $zSetup
246 sql $DATABASE_SCHEMA 251 sql $DATABASE_SCHEMA
247 252
253 wal_set_journal_mode
254
248 do_test savepoint6-$testname.setup { 255 do_test savepoint6-$testname.setup {
249 savepoint one 256 savepoint one
250 insert_rows [random_integers 100 1000] 257 insert_rows [random_integers 100 1000]
251 release one 258 release one
252 checkdb 259 checkdb
253 } {ok} 260 } {ok}
254 261
255 for {set i 0} {$i < 1000} {incr i} { 262 for {set i 0} {$i < $::G(savepoint6_iterations)} {incr i} {
256 do_test savepoint6-$testname.$i.1 { 263 do_test savepoint6-$testname.$i.1 {
257 savepoint_op 264 savepoint_op
258 checkdb 265 checkdb
259 } {ok} 266 } {ok}
260 267
261 do_test savepoint6-$testname.$i.2 { 268 do_test savepoint6-$testname.$i.2 {
262 database_op 269 database_op
263 database_op 270 database_op
264 checkdb 271 checkdb
265 } {ok} 272 } {ok}
266 } 273 }
274
275 wal_check_journal_mode savepoint6-$testname.walok
267 } 276 }
268 277
269 unset -nocomplain ::lSavepoint 278 unset -nocomplain ::lSavepoint
270 unset -nocomplain ::aEntry 279 unset -nocomplain ::aEntry
271 280
272 finish_test 281 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/savepoint2.test ('k') | third_party/sqlite/src/test/schema.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698