3 # 6c. After connect and prepare, csql goes down. it should do update for cached tables and MySQL in MySQL directly
4 # non cached csql tables will fail.
6 #Run this test only under csql/test or on this directory.
7 #Otherwise, it may fail
8 CSQL_CONF
=${PWD}/cache
/FailOver
/csql.conf
9 input
=${PWD}/cache
/FailOver
/csqlinputt3.sql
11 if [ -s "$input" -a -s "$CSQL_CONF" ]
13 REL_PATH
=${PWD}/cache
/FailOver
17 cp $REL_PATH/csql.conf
/tmp
18 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
20 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
21 DS
="$DSN $DBUSER $PASSWORD"
22 rm -f /tmp
/csql
/csqlds.conf
23 touch /tmp
/csql
/csqlds.conf
24 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
30 isql
$DS < $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
36 if [ $DSN = "oracle" ]
38 isql
$DS < $REL_PATH/orainputt1.oracle
>/dev
/null
2>&1
39 elif [ $DSN = "sybase" ]
41 isql
$DS < $REL_PATH/sybaseinputtest1.sql
>/dev
/null
2>&1
44 isql
$DS < $REL_PATH/db2inputtest1.sql
>/dev
/null
2>&1
46 isql
$DS < $REL_PATH/mysqlinputtest1.sql
>/dev
/null
2>&1
51 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
55 echo "table t1(to be cached) inserted into target db"
56 # edit /tmp/csql/csqltable.conf
57 rm -f /tmp
/csql
/csqltable.conf
58 touch /tmp
/csql
/csqltable.conf
60 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
63 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-d $DSN
71 echo "table t1 cached into csql"
73 if [ $DSN = "oracle" ]
75 isql
$DS < $REL_PATH/orainputt2.oracle
>/dev
/null
2>&1
76 elif [ $DSN = "sybase" ]
78 isql
$DS < $REL_PATH/sybaseinputtest2.sql
>/dev
/null
2>&1
81 isql
$DS < $REL_PATH/db2inputtest2.sql
>/dev
/null
2>&1
83 isql
$DS < $REL_PATH/mysqlinputtest2.sql
>/dev
/null
2>&1
91 echo "table t2(not cached) inserted into target db"
92 if [ $DSN = "oracle" ]
94 $CSQL_INSTALL_ROOT/bin
/csql
-g -s $REL_PATH/orainputt3.oracle
>/dev
/null
2>&1
96 $CSQL_INSTALL_ROOT/bin
/csql
-g -s $REL_PATH/csqlinputt3.sql
>/dev
/null
2>&1
99 echo "table t3 inserted into csql db"
101 if [ $DSN = "oracle" ]
103 ${REL_PATH}/updateprepcsqldownora
&
105 ${REL_PATH}/updateprepcsqldown
&
110 ipcrm
-M 1199 -M 2277
111 echo "csql server is down"
113 isql
$DS < $REL_PATH/dropt1t2.sql
>/dev
/null
2>&1
119 rm -f /tmp
/csql
/csqltable.conf
120 touch /tmp
/csql
/csqltable.conf