3 # 8d. After connect, prepare, execute, CSQL goes down.fetch() should return records from MySQL for cached and MySQL table.
4 # fetch() on csql non-cached table will fail.
6 #Run this test only under csql/test or on this directory.
7 #Otherwise, it may fail
9 CSQL_CONF
=${PWD}/cache
/FailOver
/csql.conf
10 input
=${PWD}/cache
/FailOver
/csqlinputt3.sql
12 if [ -s "$input" -a -s "$CSQL_CONF" ]
14 REL_PATH
=${PWD}/cache
/FailOver
16 export CSQL_CONFIG_FILE
=$REL_PATH/csql.conf
18 isql
$DSN < $REL_PATH/mysqlinputtest1.sql
>/dev
/null
2>&1
19 echo "table t1(to be cached) inserted into target db"
20 # edit /tmp/csql/csqltable.conf
21 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
22 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
23 for (( a
=1; a
<2; a
++ ))
25 echo "1:t$a NULL NULL NULL"
26 done >> /tmp
/csql
/csqltable.conf
28 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c >/dev
/null
2>&1 &
31 echo "table t1 cached into csql"
33 isql
$DSN < $REL_PATH/mysqlinputtest2.sql
>/dev
/null
2>&1
34 echo "table t2(not cached) inserted into target db"
35 $CSQL_INSTALL_ROOT/bin
/csql
-g -s $REL_PATH/csqlinputt3.sql
>/dev
/null
2>&1
36 echo "table t3 inserted into csql db"
38 ${REL_PATH}/insertexeccsqldown
&
42 echo -e "csql server is down"
44 isql
$DSN < $REL_PATH/dropall.sql
>/dev
/null
2>&1
45 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
46 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db