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

Side by Side Diff: third_party/sqlite/src/test/sharedlock.test

Issue 694353003: Get `gn gen` to succeed on Windows (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove GYP_DEFINES code Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 # 2009 July 2
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
9 #
10 #***********************************************************************
11 #
12 # $Id: sharedlock.test,v 1.1 2009/07/02 17:21:58 danielk1977 Exp $
13
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16 db close
17
18 ifcapable !shared_cache {
19 finish_test
20 return
21 }
22
23 set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
24 sqlite3 db test.db
25 sqlite3 db2 test.db
26
27 do_test sharedlock-1.1 {
28 execsql {
29 CREATE TABLE t1(a, b);
30 INSERT INTO t1 VALUES(1, 'one');
31 INSERT INTO t1 VALUES(2, 'two');
32 }
33 } {}
34
35 do_test sharedlock-1.2 {
36 set res [list]
37 db eval { SELECT * FROM t1 ORDER BY rowid } {
38 lappend res $a $b
39 if {$a == 1} { catch { db eval "INSERT INTO t1 VALUES(3, 'three')" } }
40
41 # This should fail. Connection [db] has a read-lock on t1, which should
42 # prevent connection [db2] from obtaining the write-lock it needs to
43 # modify t1. At one point there was a bug causing the previous INSERT
44 # to drop the read-lock belonging to [db].
45 if {$a == 2} { catch { db2 eval "INSERT INTO t1 VALUES(4, 'four')" } }
46 }
47 set res
48 } {1 one 2 two 3 three}
49
50 db close
51 db2 close
52
53 sqlite3_enable_shared_cache $::enable_shared_cache
54 finish_test
55
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/shared_err.test ('k') | third_party/sqlite/src/test/shortread1.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698