Skip to content

Commit

Permalink
Test case modifications to support SEE.
Browse files Browse the repository at this point in the history
  • Loading branch information
D. Richard Hipp committed Oct 12, 2018
1 parent 17909ed commit 841904a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 33 deletions.
4 changes: 2 additions & 2 deletions test/dbstatus.test
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ foreach ::lookaside_buffer_size {0 64 120} {
# The following tests focus on DBSTATUS_CACHE_USED_SHARED
#
ifcapable shared_cache {
if {[permutation]=="memsys3"
if {([permutation]=="memsys3"
|| [permutation]=="memsys5"
|| $::tcl_platform(os)=="Linux"} {
|| $::tcl_platform(os)=="Linux") && ![sqlite3 -has-codec]} {
proc do_cacheused_test {tn db res} {
set cu [sqlite3_db_status $db SQLITE_DBSTATUS_CACHE_USED 0]
set pcu [sqlite3_db_status $db SQLITE_DBSTATUS_CACHE_USED_SHARED 0]
Expand Down
6 changes: 5 additions & 1 deletion test/pragma3.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

set testdir [file dirname $argv0]
source $testdir/tester.tcl
do_not_use_codec

if {[sqlite3 -has-codec]} {
finish_test
return
}

do_execsql_test pragma3-100 {
PRAGMA data_version;
Expand Down
62 changes: 32 additions & 30 deletions test/shared.test
Original file line number Diff line number Diff line change
Expand Up @@ -1145,38 +1145,40 @@ do_test shared-$av-16.8 {

# Shared cache on named memory databases attached to readonly connections.
#
do_test shared-$av-16.8.1 {
if {![sqlite3 -has-codec]} {
do_test shared-$av-16.8.1 {
db1 close
db2 close

sqlite3 db test1.db
db eval {
CREATE TABLE yy(a, b);
INSERT INTO yy VALUES(77, 88);
}
db close

sqlite3 db1 test1.db -uri 1 -readonly 1
sqlite3 db2 test2.db -uri 1

db1 eval {
ATTACH 'file:mem?mode=memory&cache=shared' AS shared;
CREATE TABLE shared.xx(a, b);
INSERT INTO xx VALUES(55, 66);
}
db2 eval {
ATTACH 'file:mem?mode=memory&cache=shared' AS shared;
SELECT * FROM xx;
}
} {55 66}

do_test shared-$av-16.8.2 { db1 eval { SELECT * FROM yy } } {77 88}
do_test shared-$av-16.8.3 {
list [catch {db1 eval { INSERT INTO yy VALUES(1, 2) }} msg] $msg
} {1 {attempt to write a readonly database}}

db1 close
db2 close

sqlite3 db test1.db
db eval {
CREATE TABLE yy(a, b);
INSERT INTO yy VALUES(77, 88);
}
db close

sqlite3 db1 test1.db -uri 1 -readonly 1
sqlite3 db2 test2.db -uri 1

db1 eval {
ATTACH 'file:mem?mode=memory&cache=shared' AS shared;
CREATE TABLE shared.xx(a, b);
INSERT INTO xx VALUES(55, 66);
}
db2 eval {
ATTACH 'file:mem?mode=memory&cache=shared' AS shared;
SELECT * FROM xx;
}
} {55 66}

do_test shared-$av-16.8.2 { db1 eval { SELECT * FROM yy } } {77 88}
do_test shared-$av-16.8.3 {
list [catch {db1 eval { INSERT INTO yy VALUES(1, 2) }} msg] $msg
} {1 {attempt to write a readonly database}}

db1 close
db2 close
}

} ;# end of autovacuum on/off loop

Expand Down

0 comments on commit 841904a

Please sign in to comment.