Index: third_party/sqlite/src/test/crash8.test |
diff --git a/third_party/sqlite/src/test/crash8.test b/third_party/sqlite/src/test/crash8.test |
index 6424a1abb96b7e38fb5276cb4be05451fa403f37..930834a96292d53cf9a08bc00ea86e3c9e788bcd 100644 |
--- a/third_party/sqlite/src/test/crash8.test |
+++ b/third_party/sqlite/src/test/crash8.test |
@@ -243,7 +243,7 @@ do_test crash8-3.11 { |
# |
ifcapable pragma { |
reset_db |
- file delete -force test2.db |
+ forcedelete test2.db |
do_test crash8-4.1 { |
execsql { |
@@ -336,67 +336,73 @@ ifcapable pragma { |
} {def} |
do_test crash8-4.10 { |
- file delete $zMasterJournal |
+ delete_file $zMasterJournal |
execsql { SELECT b FROM main.ab WHERE a = 0 } |
} {jkl} |
} |
-for {set i 1} {$i < 10} {incr i} { |
- catch { db close } |
- file delete -force test.db test.db-journal |
- sqlite3 db test.db |
- do_test crash8-5.$i.1 { |
- execsql { |
- CREATE TABLE t1(x PRIMARY KEY); |
- INSERT INTO t1 VALUES(randomblob(900)); |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ |
- } |
- crashsql -file test.db -delay [expr ($::i%2) + 1] { |
- PRAGMA cache_size = 10; |
- BEGIN; |
- UPDATE t1 SET x = randomblob(900); |
- ROLLBACK; |
- INSERT INTO t1 VALUES(randomblob(900)); |
- } |
- execsql { PRAGMA integrity_check } |
- } {ok} |
+# |
+# Since the following tests (crash8-5.*) rely upon being able |
+# to copy a file while open, they will not work on Windows. |
+# |
+if {$::tcl_platform(platform)=="unix"} { |
+ for {set i 1} {$i < 10} {incr i} { |
+ catch { db close } |
+ forcedelete test.db test.db-journal |
+ sqlite3 db test.db |
+ do_test crash8-5.$i.1 { |
+ execsql { |
+ CREATE TABLE t1(x PRIMARY KEY); |
+ INSERT INTO t1 VALUES(randomblob(900)); |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ |
+ } |
+ crashsql -file test.db -delay [expr ($::i%2) + 1] { |
+ PRAGMA cache_size = 10; |
+ BEGIN; |
+ UPDATE t1 SET x = randomblob(900); |
+ ROLLBACK; |
+ INSERT INTO t1 VALUES(randomblob(900)); |
+ } |
+ execsql { PRAGMA integrity_check } |
+ } {ok} |
- catch { db close } |
- file delete -force test.db test.db-journal |
- sqlite3 db test.db |
- do_test crash8-5.$i.2 { |
- execsql { |
- PRAGMA cache_size = 10; |
- CREATE TABLE t1(x PRIMARY KEY); |
- INSERT INTO t1 VALUES(randomblob(900)); |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; |
- INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ |
- BEGIN; |
- UPDATE t1 SET x = randomblob(900); |
- } |
- file delete -force testX.db testX.db-journal testX.db-wal |
- copy_file test.db testX.db |
- copy_file test.db-journal testX.db-journal |
- db close |
- |
- crashsql -file test.db -delay [expr ($::i%2) + 1] { |
- SELECT * FROM sqlite_master; |
- INSERT INTO t1 VALUES(randomblob(900)); |
- } |
- |
- sqlite3 db2 testX.db |
- execsql { PRAGMA integrity_check } db2 |
- } {ok} |
+ catch { db close } |
+ forcedelete test.db test.db-journal |
+ sqlite3 db test.db |
+ do_test crash8-5.$i.2 { |
+ execsql { |
+ PRAGMA cache_size = 10; |
+ CREATE TABLE t1(x PRIMARY KEY); |
+ INSERT INTO t1 VALUES(randomblob(900)); |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; |
+ INSERT INTO t1 SELECT randomblob(900) FROM t1; /* 64 rows */ |
+ BEGIN; |
+ UPDATE t1 SET x = randomblob(900); |
+ } |
+ forcedelete testX.db testX.db-journal testX.db-wal |
+ forcecopy test.db testX.db |
+ forcecopy test.db-journal testX.db-journal |
+ db close |
+ |
+ crashsql -file test.db -delay [expr ($::i%2) + 1] { |
+ SELECT * FROM sqlite_master; |
+ INSERT INTO t1 VALUES(randomblob(900)); |
+ } |
+ |
+ sqlite3 db2 testX.db |
+ execsql { PRAGMA integrity_check } db2 |
+ } {ok} |
+ } |
+ catch {db2 close} |
} |
-catch {db2 close} |
finish_test |