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 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is the "memdb" VFS
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
20 ifcapable !deserialize {
27 #-------------------------------------------------------------------------
28 # Test that when using a memdb database, it is not possible to upgrade
29 # to an EXCLUSIVE lock if some other client is holding SHARED.
32 1 file:/test.db?vfs=memdb
33 2 file:\\test.db?vfs=memdb
35 if {$tn==2} breakpoint
36 sqlite3 db $fname -uri 1
37 sqlite3 db2 $fname -uri 1
40 do_execsql_test 1.$tn.1 {
41 CREATE TABLE t1(x, y);
42 INSERT INTO t1 VALUES(1, 2);
45 do_execsql_test -db db2 1.$tn.2 {
50 do_execsql_test 1.$tn.3 {
52 INSERT INTO t1 VALUES(3, 4);
55 do_catchsql_test 1.$tn.4 {
57 } {1 {database is locked}}
59 do_execsql_test -db db2 1.$tn.5 {
64 do_execsql_test 1.$tn.6 {
68 do_execsql_test -db db2 1.$tn.7 {