adding test scripts
[csql.git] / test / tools / csql / foreign145.sql
blobdac140d2722dd8648827438c04e138c32c27d19c
1 #!/bin/sh
2 # Create table t1 having two integer field f1 ,f2 with primary key f1 . 
3 # Create table t2 having two integer field f3,f4 with primary key f3 . 
4 # Create table t3 having two integer field f5,f6 with foreign key f5 refers t1 (f1) and foreign key f6 refers t2 (f3). 
5 # Drop table t2. It should be failed. because child t3 is exist.
7 echo CREATE TABLE t1(f1 int,f2 int,primary key(f1));
8 CREATE TABLE t1(f1 int,f2 int,primary key(f1));
9 echo CREATE TABLE t2(f3 int,f4 int,primary key(f3));
10 CREATE TABLE t2(f3 int,f4 int,primary key(f3));
11 echo CREATE TABLE t3(f5 int,f6 int,foreign key(f5) references t1(f1),foreign key(f6) references t2(f3));
12 CREATE TABLE t3(f5 int,f6 int,foreign key(f5) references t1(f1),foreign key(f6) references t2(f3));
13 echo DROP TABLE t2;
14 DROP TABLE t2;