common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / Gateway / test009.ksh
blobf5330b2cff9ea36a1b384279b5a9b3cb0d7c6d57
1 #!/bin/sh
3 # 9.Cached table there in csql, but join with another noncached table in MySQL. It should get the correct value from mysql.
5 #Run this test only under csql/test or on this directory.
6 #Otherwise, it may fail
7 CSQL_CONF=${PWD}/cache/Gateway/csql.conf
8 input=${PWD}/cache/Gateway/mysqlinputtest1.sql
9 REL_PATH=.
10 if [ -s "$input" -a -s "$CSQL_CONF" ]
11 then
12 REL_PATH=${PWD}/cache/Gateway
14 rm -f /tmp/csql.conf
15 cp $REL_PATH/csql.conf /tmp
16 export CSQL_CONFIG_FILE=/tmp/csql.conf
17 echo DSN=$DSN >>$CSQL_CONFIG_FILE
18 isql $DSN < $REL_PATH/mysqlinputtest5.sql > /dev/null 2>&1
19 if [ $? -ne 0 ]
20 then
21 echo "DSN is not set for target db"
22 exit 1
25 isql $DSN < $REL_PATH/mysqlinputtest8.sql > /dev/null 2>&1
27 # edit /tmp/csql/csqltable.conf
28 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
29 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
30 for (( a=1; a<2; a++ ))
32 echo "1:t$a NULL NULL NULL"
33 done >> /tmp/csql/csqltable.conf
35 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
36 pid=$!
37 sleep 5
39 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/join.sql
41 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
42 kill -9 $pid
43 ipcrm -M 1199 -M 2277
44 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
45 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
46 exit 0;