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 #***********************************************************************
12 # Open two database connections on the same database in shared cache
13 # mode. Hold one open while repeatedly closing, reopening, and using
16 # This test is designed to demostrate that the fix for ticket
17 # [e4a18565a36884b00edf66541f38c693827968ab] works.
21 set testdir [file dirname $argv0]
22 source $testdir/tester.tcl
23 if {[run_thread_tests]==0} { finish_test ; return }
25 set ::testprefix sharedB
27 ifcapable !shared_cache {
32 set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
34 #-------------------------------------------------------------------------
41 CREATE TABLE t1(x,y TEXT COLLATE nocase);
43 c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<100)
44 INSERT INTO t1(x,y) SELECT i, printf('x%03dy',i) FROM c;
45 CREATE INDEX t1yx ON t1(y,x);
48 SELECT x FROM t1 WHERE y='X014Y';
52 for {set j 1} {$j<=100} {incr j} {
57 SELECT x FROM t1 WHERE y='X014Y';
64 sqlite3_enable_shared_cache $::enable_shared_cache