Lines Matching refs:db1

32   sqlite3 db1 test.db
38 # 1.2.1: If [db1] has an exclusive lock, [db2] cannot read.
39 # 1.2.2: If [db1] has an exclusive lock, [db1] can read.
40 # 1.2.3: If [db1] has a non-exclusive write-lock, [db2] can read.
44 execsql { BEGIN EXCLUSIVE } db1
48 execsql { SELECT * FROM t1 } db1
55 } db1
59 execsql { COMMIT } db1
64 # 1.3.1: If [db1] has a write-lock on t1, [db1] can read from t1.
65 # 1.3.2: If [db1] has a write-lock on t1, [db2] can read from t2.
66 # 1.3.3: If [db1] has a write-lock on t1, [db2] cannot read from t1.
67 # 1.3.4: If [db1] has a write-lock on t1, [db2] cannot write to t1.
68 # 1.3.5: If [db1] has a read-lock on t1, [db2] can read from t1.
69 # 1.3.6: If [db1] has a read-lock on t1, [db2] cannot write to t1.
75 } db1
76 execsql { SELECT * FROM t1 } db1
92 } db1
99 execsql { COMMIT } db1
106 # 1.4.1: If [db1] has a write-lock on t1, [db2] can still read from t1.
107 # 1.4.2: If [db1] has a write-lock on the db schema (sqlite_master table),
109 # 1.4.3: If [db1] has a read-lock on t1, [db2] cannot write to t1.
116 } db1
120 execsql { CREATE TABLE t4(a, b) } db1
128 } db1
133 db1 close
144 sqlite3 db1 test.db -vfs unix
151 execsql { BEGIN; INSERT INTO t1 VALUES(9, 10); } db1
159 execsql { COMMIT } db1
165 execsql { SELECT * FROM t1 } db1
173 db1 close
186 sqlite3 db1 test.db
190 db1 eval {SELECT * FROM t1} {
191 # Within this block [db1] is holding a read-lock on t1. Test that
199 execsql { BEGIN EXCLUSIVE } db1
207 execsql COMMIT db1
211 catchsql { BEGIN EXCLUSIVE } db1
216 execsql { BEGIN } db1
221 catchsql { INSERT INTO t1 VALUES(1, 2) } db1
232 db1 close
239 sqlite3 db1 test.db
242 set ::STMT [sqlite3_prepare_v2 db1 "SELECT * FROM t1" -1 DUMMY]
250 db1 close