adding test scripts
[csql.git] / test / cache / CacheTable / test005.ksh
blobb63a38f6cde06329d4ec36315389f9ab5d7a6da6
1 #!/bin/ksh
2 # Test Case
4 # 5.create table, load with definition option. should fail.
6 #Run this test only under csql/test or on this directory.
7 #Otherwise, it may fail
9 input=${PWD}/cache/CacheTable/inputtest4.sql
10 REL_PATH=.
11 if [ -s "$input" ]
12 then
13 REL_PATH=${PWD}/cache/CacheTable
16 cp $CSQL_CONFIG_FILE /tmp/csql.conf
17 echo DSN=$DSN >>$CSQL_CONFIG_FILE
18 DS="$DSN $DBUSER $PASSWORD"
19 rm -f /tmp/csql/csqlds.conf
20 touch /tmp/csql/csqlds.conf
21 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
22 if [ $? -ne 0 ]
23 then
24 cp /tmp/csql.conf $CSQL_CONFIG_FILE
25 exit 1;
27 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
28 isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
29 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinput.sql > /dev/null 2>&1
31 rm -f /tmp/csql/csqltable.conf
32 touch /tmp/csql/csqltable.conf
33 ret=0
34 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 > /dev/null 2>&1
35 if [ $? -eq 0 ]
36 then
37 ret=1;
40 rm -f /tmp/csql/csqltable.conf
41 touch /tmp/csql/csqltable.conf
43 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
44 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
46 cp /tmp/csql.conf $CSQL_CONFIG_FILE
47 exit $ret;