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

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

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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/vtab_shared.test ('k') | third_party/sqlite/src/test/wal2.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/wal.test
diff --git a/third_party/sqlite/src/test/wal.test b/third_party/sqlite/src/test/wal.test
index bfe3634577b753272fe28b4aebc58b696e1c3593..bb164bb76ad1aa38a4e5d4203e608679e1001e50 100644
--- a/third_party/sqlite/src/test/wal.test
+++ b/third_party/sqlite/src/test/wal.test
@@ -712,7 +712,7 @@ do_test wal-11.5 {
do_test wal-11.6 {
execsql COMMIT
list [expr [file size test.db]/1024] [file size test.db-wal]
-} [list 3 [wal_file_size 41 1024]]
+} [list 3 [wal_file_size 40 1024]]
do_test wal-11.7 {
execsql {
SELECT count(*) FROM t1;
@@ -722,15 +722,22 @@ do_test wal-11.7 {
do_test wal-11.8 {
execsql { PRAGMA wal_checkpoint }
list [expr [file size test.db]/1024] [file size test.db-wal]
-} [list 37 [wal_file_size 41 1024]]
+} [list 37 [wal_file_size 40 1024]]
do_test wal-11.9 {
db close
list [expr [file size test.db]/1024] [log_deleted test.db-wal]
} {37 1}
sqlite3_wal db test.db
-set nWal 39
-if {[permutation]!="mmap"} {set nWal 37}
-ifcapable !mmap {set nWal 37}
+
+# After adding the capability of WAL to overwrite prior uncommitted
+# frame in the WAL-file with revised content, the size of the WAL file
+# following cache-spill is smaller.
+#
+#set nWal 39
+#if {[permutation]!="mmap"} {set nWal 37}
+#ifcapable !mmap {set nWal 37}
+set nWal 34
+
do_test wal-11.10 {
execsql {
PRAGMA cache_size = 10;
@@ -818,91 +825,6 @@ db2 close
db close
#-------------------------------------------------------------------------
-# Test large log summaries.
-#
-# In this case "large" usually means a log file that requires a wal-index
-# mapping larger than 64KB (the default initial allocation). A 64KB wal-index
-# is large enough for a log file that contains approximately 13100 frames.
-# So the following tests create logs containing at least this many frames.
-#
-# wal-13.1.*: This test case creates a very large log file within the
-# file-system (around 200MB). The log file does not contain
-# any valid frames. Test that the database file can still be
-# opened and queried, and that the invalid log file causes no
-# problems.
-#
-# wal-13.2.*: Test that a process may create a large log file and query
-# the database (including the log file that it itself created).
-#
-# wal-13.3.*: Test that if a very large log file is created, and then a
-# second connection is opened on the database file, it is possible
-# to query the database (and the very large log) using the
-# second connection.
-#
-# wal-13.4.*: Same test as wal-13.3.*. Except in this case the second
-# connection is opened by an external process.
-#
-do_test wal-13.1.1 {
- list [file exists test.db] [file exists test.db-wal]
-} {1 0}
-do_test wal-13.1.2 {
- set fd [open test.db-wal w]
- seek $fd [expr 200*1024*1024]
- puts $fd ""
- close $fd
- sqlite3 db test.db
- execsql { SELECT * FROM t2 }
-} {B 2}
-do_test wal-13.1.3 {
- db close
- file exists test.db-wal
-} {0}
-
-do_test wal-13.2.1 {
- sqlite3 db test.db
- execsql { SELECT count(*) FROM t2 }
-} {1}
-do_test wal-13.2.2 {
- db function blob blob
- for {set i 0} {$i < 16} {incr i} {
- execsql { INSERT INTO t2 SELECT blob(400), blob(400) FROM t2 }
- }
- execsql { SELECT count(*) FROM t2 }
-} [expr int(pow(2, 16))]
-do_test wal-13.2.3 {
- expr [file size test.db-wal] > [wal_file_size 33000 1024]
-} 1
-
-do_multiclient_test tn {
- incr tn 2
-
- do_test wal-13.$tn.0 {
- sql1 {
- PRAGMA journal_mode = WAL;
- CREATE TABLE t1(x);
- INSERT INTO t1 SELECT randomblob(800);
- }
- sql1 { SELECT count(*) FROM t1 }
- } {1}
-
- for {set ii 1} {$ii<16} {incr ii} {
- do_test wal-13.$tn.$ii.a {
- sql2 { INSERT INTO t1 SELECT randomblob(800) FROM t1 }
- sql2 { SELECT count(*) FROM t1 }
- } [expr (1<<$ii)]
- do_test wal-13.$tn.$ii.b {
- sql1 { SELECT count(*) FROM t1 }
- } [expr (1<<$ii)]
- do_test wal-13.$tn.$ii.c {
- sql1 { SELECT count(*) FROM t1 }
- } [expr (1<<$ii)]
- do_test wal-13.$tn.$ii.d {
- sql1 { PRAGMA integrity_check }
- } {ok}
- }
-}
-
-#-------------------------------------------------------------------------
# Check a fun corruption case has been fixed.
#
# The problem was that after performing a checkpoint using a connection
@@ -1456,6 +1378,7 @@ do_test wal-21.3 {
#-------------------------------------------------------------------------
# Test reading and writing of databases with different page-sizes.
#
+incr ::do_not_use_codec
foreach pgsz {512 1024 2048 4096 8192 16384 32768 65536} {
do_multiclient_test tn [string map [list %PGSZ% $pgsz] {
do_test wal-22.%PGSZ%.$tn.1 {
@@ -1476,6 +1399,7 @@ foreach pgsz {512 1024 2048 4096 8192 16384 32768 65536} {
} {0}
}]
}
+incr ::do_not_use_codec -1
#-------------------------------------------------------------------------
# Test that when 1 or more pages are recovered from a WAL file,
« no previous file with comments | « third_party/sqlite/src/test/vtab_shared.test ('k') | third_party/sqlite/src/test/wal2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698