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 # Make sure that attaching the same database multiple times in
13 # shared cache mode fails.
15 # $Id: shared7.test,v 1.1 2009/04/30 13:30:33 drh Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
19 ifcapable !shared_cache { finish_test ; return }
22 set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
23 sqlite3_enable_shared_cache
26 # EVIDENCE-OF: R-05098-06501 In shared cache mode, attempting to attach
27 # the same database file more than once results in an error.
36 ATTACH 'test.db' AS err1;
38 } {1 {database is already attached}}
41 forcedelete test2.db test2.db-journal
43 ATTACH 'test2.db' AS test2;
44 CREATE TABLE test2.t2(y);
47 ATTACH 'test2.db' AS err2;
49 } {1 {database is already attached}}
52 ATTACH 'test.db' AS err1;
54 } {1 {database is already attached}}
57 sqlite3_enable_shared_cache $::enable_shared_cache