removing csqltable.conf file before starting the tests
[csql.git] / test / cache / Bidirectional / test003.ksh
blob015dd72e9df5b4be6a378771ed6e33d6fbf36ef1
1 #!/bin/sh
2 # Test Case
4 # Bi-directional cache test
5 # Create two table t1,t1 that has no primary key
6 # Set bidirectional flag in csql.conf to true,Create log table in the cache and 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 isql myodbc3 < $REL_PATH/mysqlcreatelogtable.sql >/dev/null 2>&1 &
17 echo log table created in target db.
19 isql myodbc3 < $REL_PATH/create1.sql >/dev/null 2>&1
20 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
21 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
22 isql myodbc3 <$REL_PATH/trigger.sql >/dev/null
23 isql myodbc3 <$REL_PATH/trigger1.sql >/dev/null
25 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
27 for (( a=1; a<3; a++ ))
29 echo "1:t$a NULL"
30 done >> /tmp/csql/csqltable.conf
32 $CSQL_INSTALL_ROOT/bin/csqlserver -c 2>/dev/null &
33 pid=$!
34 sleep 5
35 echo "server started"
36 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql >/dev/null 2>&1
37 if [ $? -eq 0 ]
38 then
39 exit 1
42 isql myodbc3 < ${REL_PATH}/insert.sql >/dev/null 2>&1
43 sleep 15
44 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql >/dev/null 2>&1
46 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
47 isql myodbc3 < ${REL_PATH}/drop.sql >/dev/null 2>&1
48 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
49 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
51 kill -2 $pid
52 ipcrm -M 4000 -M 4500
53 exit 0;