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

Unified Diff: third_party/sqlite/src/test/tkt-f3e5abed55.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/tkt-d82e3f3721.test ('k') | third_party/sqlite/src/test/tkt-f777251dc7a.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/tkt-f3e5abed55.test
diff --git a/third_party/sqlite/src/test/tkt-f3e5abed55.test b/third_party/sqlite/src/test/tkt-f3e5abed55.test
new file mode 100644
index 0000000000000000000000000000000000000000..241c1612e0440a529f2ca72de40706f20b9aef13
--- /dev/null
+++ b/third_party/sqlite/src/test/tkt-f3e5abed55.test
@@ -0,0 +1,117 @@
+# 2010 July 29
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/malloc_common.tcl
+
+foreach f [glob -nocomplain test.db*mj*] { file delete -force $f }
+file delete -force test.db2
+
+do_test tkt-f3e5abed55-1.1 {
+ execsql {
+ ATTACH 'test.db2' AS aux;
+ CREATE TABLE main.t1(a, b);
+ CREATE TABLE aux.t2(c, d);
+ }
+} {}
+
+do_test tkt-f3e5abed55-1.2 {
+ glob -nocomplain test.db*mj*
+} {}
+
+do_test tkt-f3e5abed55-1.3 {
+ sqlite3 db2 test.db
+ execsql { BEGIN; SELECT * FROM t1 } db2
+} {}
+
+do_test tkt-f3e5abed55-1.4 {
+ execsql {
+ BEGIN;
+ INSERT INTO t1 VALUES(1, 2);
+ INSERT INTO t2 VALUES(1, 2);
+ }
+ catchsql COMMIT
+} {1 {database is locked}}
+
+do_test tkt-f3e5abed55-1.5 {
+ execsql COMMIT db2
+ execsql COMMIT
+} {}
+
+do_test tkt-f3e5abed55-1.6 {
+ glob -nocomplain test.db*mj*
+} {}
+foreach f [glob -nocomplain test.db*mj*] { file delete -force $f }
+db close
+db2 close
+
+
+
+# Set up a testvfs so that the next time SQLite tries to delete the
+# file "test.db-journal", a snapshot of the current file-system contents
+# is taken.
+#
+# This test will not work with an in-memory journal.
+#
+if {[permutation]!="inmemory_journal"} {
+ testvfs tvfs -default 1
+ tvfs script xDelete
+ tvfs filter xDelete
+ proc xDelete {method file args} {
+ if {[file tail $file] == "test.db-journal"} {
+ faultsim_save
+ tvfs filter {}
+ }
+ return "SQLITE_OK"
+ }
+
+ sqlite3 db test.db
+ sqlite3 db2 test.db
+ do_test tkt-f3e5abed55-2.1 {
+ execsql {
+ ATTACH 'test.db2' AS aux;
+ BEGIN;
+ INSERT INTO t1 VALUES(3, 4);
+ INSERT INTO t2 VALUES(3, 4);
+ }
+ } {}
+ do_test tkt-f3e5abed55-2.2 {
+ execsql { BEGIN; SELECT * FROM t1 } db2
+ } {1 2}
+ do_test tkt-f3e5abed55-2.3 {
+ catchsql COMMIT
+ } {1 {database is locked}}
+
+ do_test tkt-f3e5abed55-2.4 {
+ execsql COMMIT db2
+ execsql {
+ COMMIT;
+ SELECT * FROM t1;
+ SELECT * FROM t2;
+ }
+ } {1 2 3 4 1 2 3 4}
+ do_test tkt-f3e5abed55-2.5 {
+ db close
+ db2 close
+ faultsim_restore_and_reopen
+ execsql {
+ ATTACH 'test.db2' AS aux;
+ SELECT * FROM t1;
+ SELECT * FROM t2;
+ }
+ } {1 2 3 4 1 2 3 4}
+}
+
+
+finish_test
+
« no previous file with comments | « third_party/sqlite/src/test/tkt-d82e3f3721.test ('k') | third_party/sqlite/src/test/tkt-f777251dc7a.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698