Same fix as r45172 for classes/iconimage:
[AROS-Contrib.git] / sqlite3 / test / fkey1.test
blobd730d154ec6f37751b093da5094e37b26868bc0f
1 # 2001 September 15
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 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # This file implements tests for foreign keys.
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
19 ifcapable {!foreignkey} {
20   finish_test
21   return
24 # Create a table and some data to work with.
26 do_test fkey1-1.0 {
27   execsql {
28     CREATE TABLE t1(
29       a INTEGER PRIMARY KEY,
30       b INTEGER
31            REFERENCES t1 ON DELETE CASCADE
32            REFERENCES t2,
33       c TEXT,
34       FOREIGN KEY (b,c) REFERENCES t2(x,y) ON UPDATE CASCADE
35     );
36   }
37 } {}
38 do_test fkey1-1.1 {
39   execsql {
40     CREATE TABLE t2(
41       x INTEGER PRIMARY KEY,
42       y TEXT
43     );
44   }
45 } {}
46 do_test fkey1-1.2 {
47   execsql {
48     CREATE TABLE t3(
49       a INTEGER REFERENCES t2,
50       b INTEGER REFERENCES t1,
51       FOREIGN KEY (a,b) REFERENCES t2(x,y)
52     );
53   }
54 } {}
55    
58 finish_test