1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

More test case changes so that shared-cache mode tests all work

with normalized database names.

FossilOrigin-Name: 6f0d5f0949130a4688319adf05d37c5ccd683ca9ad2dacb7ce433a5fe18ac3c3
This commit is contained in:
drh
2020-11-19 21:01:11 +00:00
parent f4097026ef
commit e5dc4a2097
5 changed files with 21 additions and 28 deletions

View File

@ -70,13 +70,14 @@ do_test shared3-2.5 {
# test case shared3-2.3 above). The goal of the following tests is to
# ensure that the cache-size really is 10 pages.
#
if {$::tcl_platform(platform)=="unix"} {
set alternative_name ./test.db
} else {
set alternative_name TEST.DB
}
#if {$::tcl_platform(platform)=="unix"} {
# set alternative_name ./test.db
#} else {
# set alternative_name TEST.DB
#}
do_test shared3-2.6 {
sqlite3 db3 $alternative_name
#sqlite3 db3 $alternative_name
sqlite3 db3 "file:./test.db?cache=private" -uri 1
catchsql {select count(*) from sqlite_master} db3
} {0 1}
do_test shared3-2.7 {
@ -96,7 +97,7 @@ do_test shared3-2.8 {
# statement above should have caused the pager to grab an exclusive lock
# on the database file so that the cache could be spilled.
#
catch { sqlite3 db3 $alternative_name }
catch { sqlite3 db3 "file:./test.db?cache=private" -uri 1 }
catchsql {select count(*) from sqlite_master} db3
} {1 {database is locked}}

View File

@ -28,17 +28,7 @@ set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
do_test tkt2854-1.1 {
sqlite3 db test.db
sqlite3 db2 test.db
# This is taken from shared.test. The Windows VFS expands
# ./test.db (and test.db) to be the same thing so the path
# matches and they share a cache. By changing the case
# for Windows platform, we get around this and get a separate
# connection.
if {$::tcl_platform(platform)=="unix"} {
sqlite3 db3 ./test.db
} else {
sqlite3 db3 TEST.DB
}
sqlite3 db3 "file:test.db?cache=private" -uri 1
db eval {
CREATE TABLE abc(a, b, c);

View File

@ -25,8 +25,10 @@ ifcapable !shared_cache||!attach {
set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
do_test tkt3793-1.1 {
db close
sqlite3 db "file:test.db" -uri 1
sqlite3 db1 "file:test.db?cache=private" -uri 1
sqlite3 db2 test.db
sqlite3 db2 "file:test.db?cache=shared" -uri 1
execsql {
BEGIN;
CREATE TABLE t1(a, b);