adding test scripts
[csql.git] / test / tools / csql / test120.ksh
blob77b58c3af1a96677cf324762610ba6de702aa538
1 #!/bin/sh
2 # Test Case
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 t1 and insert record into t2 with same value as existing PK table key field. Delete record from t1. it should fail.
5 QUITFILE=${PWD}/tools/csql/quit.sql
6 REL_PATH=.
7 if [ -s "$QUITFILE" ]
8 then
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}/foreign3.sql
16 if [ $? -ne 0 ]
17 then
18 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drp1.sql
19 rm -f ${REL_PATH}/drp1.sql
20 exit 1;
23 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drp1.sql
24 if [ $? -ne 0 ]
25 then
26 rm -f ${REL_PATH}/drp1.sql
27 exit 3;
30 rm -f ${REL_PATH}/drp1.sql
31 exit 0;