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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/wal6.test
diff --git a/third_party/sqlite/src/test/wal6.test b/third_party/sqlite/src/test/wal6.test
index 2498907ea908549f9ecc636b0ba1ba3170565fa3..d96166ef5975eef37f4c7af86caa419ead663a90 100644
--- a/third_party/sqlite/src/test/wal6.test
+++ b/third_party/sqlite/src/test/wal6.test
@@ -193,5 +193,47 @@ do_test 3.x {
db2 close
} {}
+#-------------------------------------------------------------------------
+# Check that if a wal file has been partially checkpointed, no frames are
+# read from the checkpointed part.
+#
+reset_db
+do_execsql_test 4.1 {
+ PRAGMA page_size = 1024;
+ PRAGMA journal_mode = wal;
+ CREATE TABLE t1(a, b);
+ CREATE TABLE t2(a, b);
+ PRAGMA wal_checkpoint = truncate;
+} {wal 0 0 0}
+
+do_test 4.2 {
+ execsql { INSERT INTO t1 VALUES(1, 2) }
+ file size test.db-wal
+} [wal_file_size 1 1024]
+
+do_test 4.3 {
+ sqlite3 db2 test.db
+ execsql {
+ BEGIN;
+ INSERT INTO t2 VALUES(3, 4);
+ }
+ execsql { PRAGMA wal_checkpoint = passive } db2
+} {0 1 1}
+
+do_test 4.3 {
+ execsql { COMMIT }
+ db2 close
+ hexio_write test.db-wal 0 [string repeat 00 2000]
+ sqlite3 db2 test.db
+} {}
+
+do_test 4.4.1 {
+ catchsql { SELECT * FROM t1 } db2
+} {0 {1 2}}
+do_test 4.4.2 {
+ catchsql { SELECT * FROM t2 } db2
+} {1 {database disk image is malformed}}
+
+
finish_test
« 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