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

Unified Diff: third_party/sqlite/src/test/walfault.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/walcrash3.test ('k') | third_party/sqlite/src/test/walmode.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/walfault.test
diff --git a/third_party/sqlite/src/test/walfault.test b/third_party/sqlite/src/test/walfault.test
index 3a90f9c693d1b1c95f9bf5c091cea1391a97c916..4e7064d53b1a32c87978e02522b4c98e63a17eae 100644
--- a/third_party/sqlite/src/test/walfault.test
+++ b/third_party/sqlite/src/test/walfault.test
@@ -123,7 +123,6 @@ do_faultsim_test walfault-3 -prep {
faultsim_test_result {0 {}}
}
-
#--------------------------------------------------------------------------
#
if {[permutation] != "inmemory_journal"} {
@@ -141,7 +140,9 @@ if {[permutation] != "inmemory_journal"} {
SELECT * FROM t1;
}
} -test {
- faultsim_test_result {0 {wal 0 7 7 a b}}
+ # Update: The following changed from {0 {wal 0 7 7 a b}} as a result
+ # of PSOW being set by default.
+ faultsim_test_result {0 {wal 0 5 5 a b}}
faultsim_integrity_check
}
}
@@ -465,7 +466,7 @@ do_test walfault-13-pre-1 {
COMMIT;
}
faultsim_save_and_close
- file delete sv_test.db-shm
+ delete_file sv_test.db-shm
} {}
do_faultsim_test walfault-13.1 -prep {
@@ -542,10 +543,48 @@ do_faultsim_test walfault-14 -prep {
INSERT INTO abc VALUES(randomblob(1500));
}
} -test {
- faultsim_test_result {0 {0 10 10}}
+ faultsim_test_result {0 {0 9 9}}
faultsim_integrity_check
set nRow [db eval {SELECT count(*) FROM abc}]
if {!(($nRow==2 && $testrc) || $nRow==3)} { error "Bad db content" }
}
+#-------------------------------------------------------------------------
+# Test fault-handling when switching out of exclusive-locking mode.
+#
+do_test walfault-14-pre {
+ faultsim_delete_and_reopen
+ execsql {
+ PRAGMA auto_vacuum = 0;
+ PRAGMA journal_mode = WAL;
+ BEGIN;
+ CREATE TABLE abc(a PRIMARY KEY);
+ INSERT INTO abc VALUES(randomblob(1500));
+ INSERT INTO abc VALUES(randomblob(1500));
+ COMMIT;
+ }
+ faultsim_save_and_close
+} {}
+do_faultsim_test walfault-14 -prep {
+ faultsim_restore_and_reopen
+ execsql {
+ SELECT count(*) FROM abc;
+ PRAGMA locking_mode = exclusive;
+ BEGIN;
+ INSERT INTO abc VALUES(randomblob(1500));
+ COMMIT;
+ }
+} -body {
+ db eval {
+ PRAGMA locking_mode = normal;
+ BEGIN;
+ INSERT INTO abc VALUES(randomblob(1500));
+ COMMIT;
+ }
+} -test {
+ faultsim_integrity_check
+ set nRow [db eval {SELECT count(*) FROM abc}]
+ if {$nRow!=3 && $nRow!=4} { error "Bad db content" }
+}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/walcrash3.test ('k') | third_party/sqlite/src/test/walmode.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698