*** empty log message ***
[csql.git] / test / cache / Bidirectional / test007.ksh
blob9933c1aa3a31c79a738b98fd563950a1c8ebdf20
1 #!/bin/sh
2 # Test Case
4 # Bi-directional cache test
5 # Cache t1 and t2 table with primary key field
6 # Set bidirectional flag in csql.conf to true,Create log table from target db .Run trigger.
8 input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql
10 REL_PATH=.
11 if [ -s "$input" ]
12 then
13 REL_PATH=${PWD}/cache/Bidirectional
16 #cp $CSQL_CONFIG_FILE /tmp/csql.conf
17 #echo DSN=$DSN >>$CSQL_CONFIG_FILE
18 isql $DSN < $REL_PATH/mysqlcreatelogtable.sql >/dev/null 2>&1 &
19 echo Log table created in target DB
21 isql $DSN < $REL_PATH/create.sql >/dev/null 2>&1
22 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
23 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
24 isql $DSN <$REL_PATH/trigger.sql >/dev/null
25 isql $DSN <$REL_PATH/trigger1.sql >/dev/null
27 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
28 echo DSN=$DSN >>$CSQL_CONFIG_FILE
30 for (( a=1; a<3; a++ ))
32 echo "1:t$a NULL NULL NULL"
33 done >> /tmp/csql/csqltable.conf
35 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
36 pid=$!
37 sleep 5
38 echo "server started"
39 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
40 if [ $? -ne 0 ]
41 then
42 echo "unable to locate cache 1"
43 # cp /tmp/csql.conf $CSQL_CONFIG_FILE
44 exit 1
46 echo "Delete some record from target database"
47 isql $DSN < ${REL_PATH}/delete.sql >/dev/null 2>&1
48 sleep 15
49 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql
51 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
52 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
53 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
54 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
55 isql $DSN < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1
56 kill -2 $pid
57 ipcrm -M 4000 -M 4500
58 # cp /tmp/csql.conf $CSQL_CONFIG_FILE
59 exit 0;