common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / Gateway / test012b.ksh
blobbd614a4875d792d081b3753f453cbd104410e342
1 #!/bin/sh
3 # 12.csqlserver not running
4 # b)connect, update
5 # noncached 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 /tmp/csql.conf
17 cp $REL_PATH/csql.conf /tmp/csql.conf
18 export CSQL_CONFIG_FILE=/tmp/csql.conf
19 echo DSN=$DSN >> $CSQL_CONFIG_FILE
20 isql $DSN < $REL_PATH/mysqlinputtest1.sql > /dev/null 2>&1
21 if [ $? -ne 0 ]
22 then
23 echo "DSN is not set for target db"
24 exit 1
26 isql $DSN < $REL_PATH/mysqlinputtest12.sql > /dev/null 2>&1
28 # edit /tmp/csql/csqltable.conf
29 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
30 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
31 for (( a=1; a<2; a++ ))
33 echo "1:t$a NULL NULL NULL"
34 done >> /tmp/csql/csqltable.conf
36 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
37 pid=$!
38 sleep 5
39 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputtest12.sql >/dev/null 2>&1
40 kill -9 $pid
41 ipcrm -M 1199 -M 2277
43 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/updatet2.sql
44 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/update.sql
45 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/updatet3.sql
46 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstart2.sql
47 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
48 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstart3.sql
49 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
51 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
52 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
53 exit 0;