aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test
diff options
context:
space:
mode:
authordan miller2007-10-20 02:49:29 +0000
committerdan miller2007-10-20 02:49:29 +0000
commite36d23a85ebff914d74bb541558c2b6082b78edb (patch)
tree54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test
parent* Fixed an issue whereby avatar chat distances were being calculated against ... (diff)
downloadopensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2
opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test77
1 files changed, 77 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test b/libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test
new file mode 100644
index 0000000..52b52d3
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/fkey1.test
@@ -0,0 +1,77 @@
1# 2001 September 15
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.
12#
13# This file implements tests for foreign keys.
14#
15
16set testdir [file dirname $argv0]
17source $testdir/tester.tcl
18
19ifcapable {!foreignkey} {
20 finish_test
21 return
22}
23
24# Create a table and some data to work with.
25#
26do_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} {}
38do_test fkey1-1.1 {
39 execsql {
40 CREATE TABLE t2(
41 x INTEGER PRIMARY KEY,
42 y TEXT
43 );
44 }
45} {}
46do_test fkey1-1.2 {
47 execsql {
48 CREATE TABLE t3(
49 a INTEGER REFERENCES t2 ON INSERT RESTRICT,
50 b INTEGER REFERENCES t1,
51 FOREIGN KEY (a,b) REFERENCES t2(x,y)
52 );
53 }
54} {}
55
56do_test fkey1-2.1 {
57 execsql {
58 CREATE TABLE t4(a integer primary key);
59 CREATE TABLE t5(x references t4);
60 CREATE TABLE t6(x references t4);
61 CREATE TABLE t7(x references t4);
62 CREATE TABLE t8(x references t4);
63 CREATE TABLE t9(x references t4);
64 CREATE TABLE t10(x references t4);
65 DROP TABLE t7;
66 DROP TABLE t9;
67 DROP TABLE t5;
68 DROP TABLE t8;
69 DROP TABLE t6;
70 DROP TABLE t10;
71 }
72} {}
73
74
75
76
77finish_test