adding test scripts
[csql.git] / test / cache / CacheTable / test004.ksh
blob09e5424604649d0dd0b403428591162ea1d9a96e
1 #!/bin/ksh
2 # Test Case
4 # 4.create table, insert some records into the table and then load with no 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 CACHE_TABLE=true >>$CSQL_CONFIG_FILE
18 echo DSN=$DSN >>$CSQL_CONFIG_FILE
19 DS="$DSN $DBUSER $PASSWORD"
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 cp /tmp/csql.conf $CSQL_CONFIG_FILE
26 exit 1;
29 isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
30 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputwithrec.sql > /dev/null 2>&1
31 if [ $? -ne 0 ]
32 then
33 cp /tmp/csql.conf $CSQL_CONFIG_FILE
34 exit 1;
37 rm -f /tmp/csql/csqltable.conf
38 touch /tmp/csql/csqltable.conf
40 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1
41 if [ $? -eq 0 ]
42 then
43 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
44 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
45 rm -f /tmp/csql/csqltable.conf
46 touch /tmp/csql/csqltable.conf
47 cp /tmp/csql.conf $CSQL_CONFIG_FILE
48 exit 2;
51 rm -f /tmp/csql/csqltable.conf
52 touch /tmp/csql/csqltable.conf
53 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
54 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
56 cp /tmp/csql.conf $CSQL_CONFIG_FILE
57 exit 0;