changes for windows jdbc driverw
[csql.git] / test / cache / DDL / test002.ksh
blob3db7c853b79696924de9698d780bc2bfd419822e
1 #!/bin/ksh
3 # create table t1 in csql and TDB. Recover t1.
4 # It should fail saying table already exists
6 CSQL_CONF=${PWD}/cache/DDL/csql.conf
7 input=${PWD}/cache/DDL/mysqlinputtest1.sql
8 REL_PATH=.
9 if [ -s "$input" ]
10 then
11 REL_PATH=${PWD}/cache/DDL
14 rm -f /tmp/csql.conf
15 cp $REL_PATH/csql.conf /tmp
16 export CSQL_CONFIG_FILE=/tmp/csql.conf
18 DS="$DSN $DBUSER $PASSWORD"
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 rm -f /tmp/csql/csqlds.conf
21 touch /tmp/csql/csqlds.conf
22 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
23 if [ $? -ne 0 ]
24 then
25 exit 1;
29 if [ $DSN = "oracle" ]
30 then
31 isql $DS < $REL_PATH/oratest1.oracle > /dev/null 2>&1
32 elif [ "$DSN" = "sybase" ]
33 then
34 isql $DS < $REL_PATH/sybaseinputtest1.sql > /dev/null 2>&1
35 elif [ "$DSN" = "db2" ]
36 then
37 isql $DS < $REL_PATH/db2inputtest1.sql > /dev/null 2>&1
38 else
39 isql $DS < $REL_PATH/mysqlinputtest1.sql > /dev/null 2>&1
42 # edit /tmp/csql/csqltable.conf
43 rm -f /tmp/csql/csqltable.conf
44 touch /tmp/csql/csqltable.conf
45 echo "1 t1 NULL NULL NULL $DSN" >/tmp/csql/csqltable.conf
46 $CSQL_INSTALL_ROOT/bin/csqlserver -c > /dev/null 2>&1 &
47 pid=$!
48 sleep 5
49 if [ "$VALGRIND" = "true" ]
50 then
51 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql 2> $0.valgrelse
52 else
53 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql
55 isql $DS < $REL_PATH/dropall.sql > /dev/null 2>&1
56 rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf
57 touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf
58 if [ "$VALGRIND" = "true" ]
59 then
60 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql 2>> $0.valgr
61 else
62 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql
65 kill -9 $pid
66 ipcrm -M 1199 -M 2277 -M 1947
67 exit 0;