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

Unified Diff: third_party/sqlite/src/test/crash8.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/corruptE.test ('k') | third_party/sqlite/src/test/ctime.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e7f814e26f65540b718c645740bfab5e5e09959..6424a1abb96b7e38fb5276cb4be05451fa403f37 100644
--- a/third_party/sqlite/src/test/crash8.test
+++ b/third_party/sqlite/src/test/crash8.test
@@ -258,6 +258,7 @@ ifcapable pragma {
INSERT INTO ab VALUES(6, NULL);
UPDATE ab SET b = randstr(1000,1000);
ATTACH 'test2.db' AS aux;
+ PRAGMA aux.journal_mode = persist;
CREATE TABLE aux.ab(a, b);
INSERT INTO aux.ab SELECT * FROM main.ab;
@@ -340,4 +341,62 @@ ifcapable pragma {
} {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}
+
+ 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 {db2 close}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/corruptE.test ('k') | third_party/sqlite/src/test/ctime.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698