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

Unified Diff: third_party/sqlite/src/test/wal6.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/wal5.test ('k') | third_party/sqlite/src/test/wal8.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 d96166ef5975eef37f4c7af86caa419ead663a90..9bbc58409d623642547a595e066e3783c9e6862e 100644
--- a/third_party/sqlite/src/test/wal6.test
+++ b/third_party/sqlite/src/test/wal6.test
@@ -234,6 +234,36 @@ do_test 4.4.2 {
catchsql { SELECT * FROM t2 } db2
} {1 {database disk image is malformed}}
+#-------------------------------------------------------------------------
+# Confirm that it is possible to get an SQLITE_BUSY_SNAPSHOT error from
+# "BEGIN EXCLUSIVE" if the connection already has an open read-transaction.
+#
+db close
+db2 close
+reset_db
+sqlite3 db2 test.db
+do_execsql_test 5.1 {
+ PRAGMA journal_mode = wal;
+ CREATE TABLE t1(x, y);
+ INSERT INTO t1 VALUES(1, 2);
+ INSERT INTO t1 VALUES(3, 4);
+} {wal}
+do_test 5.2 {
+ set res [list]
+ db eval {
+ SELECT * FROM t1
+ } {
+ if {$x==1} {
+ db2 eval { INSERT INTO t1 VALUES(5, 6) }
+ }
+ if {$x==3} {
+ set res [catchsql {BEGIN EXCLUSIVE}]
+ lappend res [sqlite3_extended_errcode db]
+ }
+ }
+ set res
+} {1 {database is locked} SQLITE_BUSY_SNAPSHOT}
-finish_test
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/wal5.test ('k') | third_party/sqlite/src/test/wal8.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698