3 # 4a) After connect, csql goes down, then all select operations should go to MySQL directly for cached tables and MySQL tables.
5 #Run this test only under csql/test or on this directory.
6 #Otherwise, it may fail
7 CSQL_CONF
=${PWD}/cache
/FailOver
/csql.conf
8 input
=${PWD}/cache
/FailOver
/csqlinputt3.sql
10 if [ -s "$input" -a -s "$CSQL_CONF" ]
12 REL_PATH
=${PWD}/cache
/FailOver
15 cp $REL_PATH/csql.conf
/tmp
16 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
18 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
19 DS
="$DSN $DBUSER $PASSWORD"
20 rm -f /tmp
/csql
/csqlds.conf
21 touch /tmp
/csql
/csqlds.conf
22 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
28 isql
$DS < $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
34 if [ $DSN = "oracle" ]
36 isql
$DS < $REL_PATH/orainputt1.oracle
>/dev
/null
2>&1
37 elif [ $DSN = "sybase" ]
39 isql
$DS < $REL_PATH/sybaseinputtest1.sql
>/dev
/null
2>&1
42 isql
$DS < $REL_PATH/db2inputtest1.sql
>/dev
/null
2>&1
44 isql
$DS < $REL_PATH/mysqlinputtest1.sql
>/dev
/null
2>&1
47 echo "table t1(to be cached) inserted into target db"
48 # edit /tmp/csql/csqltable.conf
49 rm -f /tmp
/csql
/csqltable.conf
50 touch /tmp
/csql
/csqltable.conf
52 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
55 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-d $DSN
63 echo "table t1 cached into csql"
65 if [ $DSN = "oracle" ]
67 isql
$DS < $REL_PATH/orainputt2.oracle
>/dev
/null
2>&1
68 elif [ $DSN = "sybase" ]
70 isql
$DS < $REL_PATH/sybaseinputtest2.sql
>/dev
/null
2>&1
73 isql
$DS < $REL_PATH/db2inputtest2.sql
>/dev
/null
2>&1
75 isql
$DS < $REL_PATH/mysqlinputtest2.sql
>/dev
/null
2>&1
78 echo "table t2(not cached) inserted into target db"
80 if [ $DSN = "oracle" ]
82 $CSQL_INSTALL_ROOT/bin
/csql
-g -s $REL_PATH/orainputt3.oracle
>/dev
/null
2>&1
84 $CSQL_INSTALL_ROOT/bin
/csql
-g -s $REL_PATH/csqlinputt3.sql
>/dev
/null
2>&1
87 echo "table t3 inserted into csql db"
89 $REL_PATH/selectconncsqldown
&
93 echo "csql server is down"
95 isql
$DS < $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
101 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
102 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf