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

Unified Diff: third_party/sqlite/sqlite-src-3080704/test/lock7.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
Index: third_party/sqlite/sqlite-src-3080704/test/lock7.test
diff --git a/third_party/sqlite/sqlite-src-3080704/test/lock7.test b/third_party/sqlite/sqlite-src-3080704/test/lock7.test
new file mode 100644
index 0000000000000000000000000000000000000000..02f2c6c6305079d7f1e5dcc17a7c4e4a1ce108f4
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3080704/test/lock7.test
@@ -0,0 +1,60 @@
+# 2009 August 17
+#
+# 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.
+#
+#***********************************************************************
+#
+# Check that reading the database schema from within an active transaction
+# does not establish a SHARED lock on the database file if one is not
+# already held (or, more accurately, that the SHARED lock is released after
+# reading the database schema).
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+do_test lock7-1.1 {
+ execsql { CREATE TABLE t1(a, b) }
+ db close
+
+ sqlite3 db1 test.db
+ sqlite3 db2 test.db
+
+ db1 eval {BEGIN}
+ db2 eval {BEGIN}
+} {}
+
+do_test lock7-1.2 {
+ execsql { PRAGMA lock_status } db1
+} {main unlocked temp closed}
+do_test lock7-1.3 {
+ execsql { PRAGMA lock_status } db2
+} {main unlocked temp closed}
+
+do_test lock7-1.4 {
+ catchsql { INSERT INTO t1 VALUES(1, 1) } db1
+} {0 {}}
+do_test lock7-1.5 {
+ catchsql { INSERT INTO t1 VALUES(2, 2) } db2
+} {1 {database is locked}}
+
+do_test lock7-1.6 {
+ execsql { PRAGMA lock_status } db1
+} {main reserved temp closed}
+do_test lock7-1.7 {
+ execsql { PRAGMA lock_status } db2
+} {main unlocked temp closed}
+
+do_test lock7-1.8 {
+ execsql { COMMIT } db1
+} {}
+
+db1 close
+db2 close
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/lock6.test ('k') | third_party/sqlite/sqlite-src-3080704/test/lock_common.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698