8030 libmvect: uninitialized variable
[unleashed.git] / usr / src / lib / libsqlite / test / fkey1.test
blob4e0b4d6400822cc49485a5b14cf41e60928fa353
2 #pragma ident   "%Z%%M% %I%     %E% SMI"
4 # 2001 September 15
6 # The author disclaims copyright to this source code.  In place of
7 # a legal notice, here is a blessing:
9 #    May you do good and not evil.
10 #    May you find forgiveness for yourself and forgive others.
11 #    May you share freely, never taking more than you give.
13 #***********************************************************************
14 # This file implements regression tests for SQLite library.
16 # This file implements tests for foreign keys.
19 set testdir [file dirname $argv0]
20 source $testdir/tester.tcl
22 # Create a table and some data to work with.
24 do_test fkey1-1.0 {
25   execsql {
26     CREATE TABLE t1(
27       a INTEGER PRIMARY KEY,
28       b INTEGER
29            REFERENCES t1 ON DELETE CASCADE
30            REFERENCES t2,
31       c TEXT,
32       FOREIGN KEY (b,c) REFERENCES t2(x,y) ON UPDATE CASCADE
33     );
34   }
35 } {}
36 do_test fkey1-1.1 {
37   execsql {
38     CREATE TABLE t2(
39       x INTEGER PRIMARY KEY,
40       y TEXT
41     );
42   }
43 } {}
44 do_test fkey1-1.2 {
45   execsql {
46     CREATE TABLE t3(
47       a INTEGER REFERENCES t2,
48       b INTEGER REFERENCES t1,
49       FOREIGN KEY (a,b) REFERENCES t2(x,y)
50     );
51   }
52 } {}
53    
56 finish_test