3 # 4b. After connect, csql goes down, then all insert 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
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
15 export CSQL_CONFIG_FILE
=$REL_PATH/csql.conf
16 echo DSN
=$DSN >> $CSQL_CONFIG_FILE
17 isql
$DSN < $REL_PATH/mysqlinputtest1.sql
>/dev
/null
2>&1
18 echo "table t1(to be cached) inserted into target db"
19 # edit /tmp/csql/csqltable.conf
20 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
21 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
22 for (( a
=1; a
<2; a
++ ))
24 echo "1:t$a NULL NULL NULL"
25 done >> /tmp
/csql
/csqltable.conf
27 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c >/dev
/null
2>&1 &
30 echo "table t1 cached into csql"
32 isql
$DSN < $REL_PATH/mysqlinputtest2.sql
>/dev
/null
2>&1
33 echo "table t2(not cached) inserted into target db"
34 $CSQL_INSTALL_ROOT/bin
/csql
-g -s $REL_PATH/csqlinputt3.sql
>/dev
/null
2>&1
35 echo "table t3 inserted into csql db"
37 ${REL_PATH}/insertconncsqldown
&
41 echo -e "csql server is down"
43 isql
$DSN < $REL_PATH/dropall.sql
>/dev
/null
2>&1
44 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
45 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db