common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / Gateway / test010.ksh
blob1b98eb466c34b6683a103a4a5c0bcf18d1228d2b
1 #!/bin/sh
3 # 10.Table there in csql and mysql and not cached. insert should insert only to csql table.
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/mysqlinputtest1.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/selectstar.sql
26 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
27 pid=$!
28 sleep 5
29 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputtest10.sql >/dev/null 2>&1
30 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
31 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/insert.sql
32 isql $DSN < $REL_PATH/selectstar.sql
33 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
34 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
35 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
37 kill -9 $pid
38 ipcrm -M 1199 -M 2277
39 exit 0;