xref: /sqlite-3.40.0/test/attach2.test (revision c023e03e)
1# 2003 July 1
2#
3# The author disclaims copyright to this source code.  In place of
4# a legal notice, here is a blessing:
5#
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.
9#
10#***********************************************************************
11# This file implements regression tests for SQLite library.  The
12# focus of this script is testing the ATTACH and DETACH commands
13# and related functionality.
14#
15# $Id: attach2.test,v 1.2 2003/07/18 01:25:35 drh Exp $
16#
17
18
19set testdir [file dirname $argv0]
20source $testdir/tester.tcl
21
22# Ticket #354
23#
24do_test attach2-1.1 {
25  db eval {
26    CREATE TABLE t1(a,b);
27    CREATE INDEX x1 ON t1(a);
28  }
29  file delete -force test2.db
30  sqlite db2 test2.db
31  db2 eval {
32    CREATE TABLE t1(a,b);
33    CREATE INDEX x1 ON t1(a);
34  }
35  catchsql {
36    ATTACH 'test2.db' AS t2;
37  }
38} {0 {}}
39
40db close
41for {set i 2} {$i<=15} {incr i} {
42  catch {db$i close}
43}
44file delete -force test2.db
45
46
47finish_test
48