common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / Gateway / test012a.ksh
blob3d8a351128a49c9075637ac67f2b5546e501d4d5
1 #!/bin/sh
3 # 12.csqlserver not running
4 # a)connect,select
5 # oncached table in mysql(should work), cached table (work), csql table (fail)
7 #Run this test only under csql/test or on this directory.
8 #Otherwise, it may fail
9 CSQL_CONF=${PWD}/cache/Gateway/csql.conf
10 input=${PWD}/cache/Gateway/mysqlinputtest1.sql
11 REL_PATH=.
12 if [ -s "$input" -a -s "$CSQL_CONF" ]
13 then
14 REL_PATH=${PWD}/cache/Gateway
16 rm -f /tmp/csql.conf
17 cp $REL_PATH/csql.conf /tmp
18 export CSQL_CONFIG_FILE=/tmp/csql.conf
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
21 isql $DSN < $REL_PATH/mysqlinputtest1.sql > /dev/null 2>&1
22 if [ $? -ne 0 ]
23 then
24 echo "DSN is not set for target db"
25 exit 1
28 isql $DSN < $REL_PATH/mysqlinputtest12.sql > /dev/null 2>&1
30 # edit /tmp/csql/csqltable.conf
31 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
32 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
33 for (( a=1; a<2; a++ ))
35 echo "1:t$a NULL NULL NULL"
36 done >> /tmp/csql/csqltable.conf
38 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
39 pid=$!
40 sleep 5
41 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputtest12.sql >/dev/null 2>&1
42 kill -9 $pid
43 ipcrm -M 1199 -M 2277
45 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstart2.sql
46 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
47 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstart3.sql
48 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
50 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
51 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
52 exit 0;