2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A# 2001 September 15
2N/A#
2N/A# The author disclaims copyright to this source code. In place of
2N/A# a legal notice, here is a blessing:
2N/A#
2N/A# May you do good and not evil.
2N/A# May you find forgiveness for yourself and forgive others.
2N/A# May you share freely, never taking more than you give.
2N/A#
2N/A#***********************************************************************
2N/A# This file implements regression tests for SQLite library.
2N/A#
2N/A# This file implements tests for foreign keys.
2N/A#
2N/A
2N/Aset testdir [file dirname $argv0]
2N/Asource $testdir/tester.tcl
2N/A
2N/A# Create a table and some data to work with.
2N/A#
2N/Ado_test fkey1-1.0 {
2N/A execsql {
2N/A CREATE TABLE t1(
2N/A a INTEGER PRIMARY KEY,
2N/A b INTEGER
2N/A REFERENCES t1 ON DELETE CASCADE
2N/A REFERENCES t2,
2N/A c TEXT,
2N/A FOREIGN KEY (b,c) REFERENCES t2(x,y) ON UPDATE CASCADE
2N/A );
2N/A }
2N/A} {}
2N/Ado_test fkey1-1.1 {
2N/A execsql {
2N/A CREATE TABLE t2(
2N/A x INTEGER PRIMARY KEY,
2N/A y TEXT
2N/A );
2N/A }
2N/A} {}
2N/Ado_test fkey1-1.2 {
2N/A execsql {
2N/A CREATE TABLE t3(
2N/A a INTEGER REFERENCES t2,
2N/A b INTEGER REFERENCES t1,
2N/A FOREIGN KEY (a,b) REFERENCES t2(x,y)
2N/A );
2N/A }
2N/A} {}
2N/A
2N/A
2N/A
2N/Afinish_test