blob: 484d2e96e95e9df1a62cd74008f033c986587c18 [file] [log] [blame] [edit]
# 2017 April 25
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this script is testing the server mode of SQLite.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
set testprefix server3
source $testdir/server_common.tcl
return_if_no_server
foreach {tn vfs} {1 unix-excl 2 unix} {
server_set_vfs $vfs
server_reset_db
server_sqlite3 db2 test.db
do_test 1.1 {
db eval { CREATE TABLE t1(a, b) }
db2 eval { CREATE TABLE t2(a, b) }
} {}
do_test 1.2 {
db eval {
INSERT INTO t2 VALUES(1, 2);
BEGIN;
INSERT INTO t1 VALUES(1, 2);
}
} {}
do_test 1.3 {
list [catch { db2 eval { SELECT * FROM t1 } } msg] $msg
} {1 {database is locked}}
do_test 1.4 {
list [catch { db2 eval { SELECT * FROM t1 } } msg] $msg
} {1 {database is locked}}
do_test 1.4 {
db2 eval { SELECT * FROM t2 }
} {1 2}
}
finish_test