adding test scripts
[csql.git] / test / cache / CacheTable / test003.ksh
blob7637b884fe866ad923d36edf1736e698f93f912f
1 #!/bin/ksh
2 # Test Case
4 # 3.create table, load with no definition option. should succeed and csqldump should display the records.
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
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;
28 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
29 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql > /dev/null 2>&1
31 isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
32 if [ "$DSN" = "oracle" ]
33 then
34 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputoracle.sql > /dev/null 2>&1
35 else
36 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinput.sql > /dev/null 2>&1
38 if [ $? -ne 0 ]
39 then
40 cp /tmp/csql.conf $CSQL_CONFIG_FILE
41 exit 1;
44 rm -f /tmp/csql/csqltable.conf
45 touch /tmp/csql/csqltable.conf
47 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s > /dev/null 2>&1
48 if [ $? -ne 0 ]
49 then
50 cp /tmp/csql.conf $CSQL_CONFIG_FILE
51 exit 2;
54 rm -f /tmp/csql/csqltable.conf
55 touch /tmp/csql/csqltable.conf
57 $CSQL_INSTALL_ROOT/bin/csqldump
58 if [ $? -ne 0 ]
59 then
60 cp /tmp/csql.conf $CSQL_CONFIG_FILE
61 exit 3;
63 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
64 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
65 rm -f /tmp/csql/csqltable.conf
66 touch /tmp/csql/csqltable.conf
67 cp /tmp/csql.conf $CSQL_CONFIG_FILE
68 exit 0;