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