3 # Create table t1 having three integer field f1 ,f2,f3 with composite primary key (f1,f2) and create table t2 having three integer field f1,f2,f3 with foreign key (f1,f3) refers t1 (f1,f2). Insert some record into t2 .It should fail to insert record as PK table has no record.
5 QUITFILE
=${PWD}/tools
/csql
/quit.sql
9 REL_PATH
=`pwd`/tools
/csql
12 echo "drop table t2;" >${REL_PATH}/drp1.sql
13 echo "drop table t1;" >>${REL_PATH}/drp1.sql
15 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/foreign1.sql
18 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drp1.sql
19 rm -f ${REL_PATH}/drp1.sql
23 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drp1.sql
26 rm -f ${REL_PATH}/drp1.sql
30 rm -f ${REL_PATH}/drp1.sql