*** empty log message ***
[csql.git] / test / cache / CacheTable / test018.ksh
blob6e99ac741c1d50142520a47fa9069662da5065ab
1 #!/bin/ksh
2 #Test Case
4 #18. load t1 table with records in target DB,
5 # create a t1 table in CSQL without record.
6 # load with -s option, it should pass.
8 # AUTHOR : Jitendra Lenka
10 input=${PWD}/cache/CacheTable/inputtest4.sql
11 REL_PATH=.
12 if [ -s "$input" ]
13 then
14 REL_PATH=${PWD}/cache/CacheTable
17 cp $CSQL_CONFIG_FILE /tmp/csql.conf
18 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 DS="$DSN $DBUSER $PASSWORD"
21 rm -f /tmp/csql/csqlds.conf
22 touch /tmp/csql/csqlds.conf
23 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
24 if [ $? -ne 0 ]
25 then
26 cp /tmp/csql.conf $CSQL_CONFIG_FILE
27 exit 1;
30 isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
31 if [ "$DSN" = "oracle" ]
32 then
33 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlinputoracle.sql > /dev/null 2>&1
34 else
35 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlinput.sql > /dev/null 2>&1
37 if [ $? -ne 0 ]
38 then
39 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
40 rm -f /tmp/csql/csqltable.conf
41 touch /tmp/csql/csqltable.conf
42 cp /tmp/csql.conf $CSQL_CONFIG_FILE
43 exit 2;
46 rm -f /tmp/csql/csqltable.conf
47 touch /tmp/csql/csqltable.conf
49 # caching with -s option
50 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1
51 if [ $? -ne 0 ]
52 then
53 rm -f /tmp/csql/csqltable.conf
54 touch /tmp/csql/csqltable.conf
55 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
56 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
57 cp /tmp/csql.conf $CSQL_CONFIG_FILE
58 exit 3;
61 echo "select * from t1;"
62 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/selectt1.sql
63 if [ $? -ne 0 ]
64 then
65 rm -f /tmp/csql/csqltable.conf
66 touch /tmp/csql/csqltable.conf
67 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
68 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
69 cp /tmp/csql.conf $CSQL_CONFIG_FILE
70 exit 4;
72 rm -f /tmp/csql/csqltable.conf
73 touch /tmp/csql/csqltable.conf
75 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
76 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
77 cp /tmp/csql.conf $CSQL_CONFIG_FILE
78 exit 0;