3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
12 # Check that reading the database schema from within an active transaction
13 # does not establish a SHARED lock on the database file if one is not
14 # already held (or, more accurately, that the SHARED lock is released after
15 # reading the database schema).
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
22 execsql { CREATE TABLE t1(a, b) }
33 execsql { PRAGMA lock_status } db1
34 } {main unlocked temp closed}
36 execsql { PRAGMA lock_status } db2
37 } {main unlocked temp closed}
40 catchsql { INSERT INTO t1 VALUES(1, 1) } db1
43 catchsql { INSERT INTO t1 VALUES(2, 2) } db2
44 } {1 {database is locked}}
47 execsql { PRAGMA lock_status } db1
48 } {main reserved temp closed}
50 execsql { PRAGMA lock_status } db2
51 } {main unlocked temp closed}
54 execsql { COMMIT } db1