adding test scripts
[csql.git] / test / adapter / Select / test008na.ksh
blob76779e603fd8fa1e9b4473637731e58df37df688
1 #!/bin/ksh
2 # prepare,execute,free,prepare, second prepare should pass.
5 CSQL_CONF=${PWD}/adapter/Select/csql.conf
6 REL_PATH=.
7 if [ -s "$CSQL_CONF" ]
8 then
9 REL_PATH=${PWD}/adapter/Select
12 rm -f /tmp/csql.conf
13 cp $REL_PATH/csql.conf /tmp/csql.conf
14 echo CSQL_SQL_SERVER=true >>/tmp/csql.conf
15 #echo PORT= >>/tmp/csql.conf
16 export CSQL_CONFIG_FILE=/tmp/csql.conf
17 if [ -z "$DBUSER" ]
18 then
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 if [ $DSN = "psql" ]
21 then
22 echo TARGET_DATABASE=postgres >>$CSQL_CONFIG_FILE
23 else
24 echo TARGET_DATABASE=mysql >>$CSQL_CONFIG_FILE
26 DS=$DSN
27 else
28 echo DSN=$DSN >>$CSQL_CONFIG_FILE
29 echo DBUSER=$DBUSER >>$CSQL_CONFIG_FILE
30 echo PASSWORD=$PASSWORD >>$CSQL_CONFIG_FILE
31 echo TARGET_DATABASE=oracle >>$CSQL_CONFIG_FILE
32 DS="$DSN $DBUSER $PASSWORD"
35 $CSQL_INSTALL_ROOT/bin/csqlsqlserver >/dev/null 2>&1 &
36 pid=$!
37 sleep 3
38 ${REL_PATH}/selecttest8na
39 if [ $? -ne 0 ]
40 then
41 kill -9 $pid
42 exit 1;
44 rm -f /tmp/csql.conf
45 kill -9 $pid
46 exit 0;