Artifact
97040670597948a695b1973537d770417589f1998bcbb3959302aaee3c211250:
- File
test/server4.test
— part of check-in
[e77d29f6]
at
2017-07-24 19:23:20
on branch server-process-edition
— Only open a db in server-mode if there is a directory named "db-journal"
in the file-system and the VFS is an exclusive locking VFS.
(user:
dan
size: 1345)
- File
test/serverreadonly.test
— part of check-in
[abb6e076]
at
2017-08-18 18:55:22
on branch server-process-edition
— Add tests to this branch.
(user:
dan
size: 1345)
# 2017 July 09
#
# 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.
# Specifically, that "BEGIN READONLY" starts a read-only MVCC
# transaction.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lock_common.tcl
set testprefix server4
source $testdir/server_common.tcl
return_if_no_server
server_reset_db
server_sqlite3 db2 test.db
do_execsql_test 1.0 {
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(x);
INSERT INTO t2 VALUES(1);
BEGIN;
INSERT INTO t1 VALUES(2);
INSERT INTO t2 VALUES(2);
}
do_execsql_test -db db2 1.1 {
BEGIN READONLY;
SELECT * FROM t1;
} {1}
do_execsql_test 1.2 {
COMMIT;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
} {1 2 3}
do_execsql_test 1.2a {
INSERT INTO t2 VALUES(3);
} {}
do_execsql_test -db db2 1.3 {
SELECT * FROM t2;
} {1}
do_execsql_test -db db2 1.4 {
ROLLBACK;
SELECT * FROM t1;
} {1 2 3}
finish_test