*** empty log message ***
[csql.git] / test / cache / CacheTable / test016.ksh
blob740e5667cbd2ce1948ae3e5845172695f073fa65
1 #!/bin/sh
2 #Test case
3 #16. create table t1,t2 in target DB with 10 records.
4 # load t1 table with condition option
5 # load t2 table with condition .
7 # unload the two tables t1,t2 with -u option.
9 #Run this test only under csql/test or on this derectory.
10 #otherwise, it mat fail.
12 # AUTHOR : Jitendra Lenka
14 input=${PWD}/cache/CacheTable/inputtest4.sql
15 REL_PATH=.
16 if [ -s "$input" ]
17 then
18 REL_PATH=${PWD}/cache/CacheTable
21 cp $CSQL_CONFIG_FILE /tmp/csql.conf
22 echo DSN=$DSN >>$CSQL_CONFIG_FILE
23 # create table t1,t2 in target DB.
24 isql $DSN < ${REL_PATH}/create.sql >/dev/null 2>&1
25 if [ $? -ne 0 ]
26 then
27 cp /tmp/csql.conf $CSQL_CONFIG_FILE
28 exit 1;
31 echo Table t1 and t2 created in target DB.
33 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
34 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 echo "cachetable -t t1"
37 echo "cachetable -t t2 -c \"t2f1<5\" "
39 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
40 if [ $? -ne 0 ]
41 then
42 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
43 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
45 cp /tmp/csql.conf $CSQL_CONFIG_FILE
46 exit 2;
49 echo "Table t1 unloaded from CSQL"
51 $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1<5" >/dev/null 2>&1
52 if [ $? -ne 0 ]
53 then
54 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
55 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
57 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql >/dev/null 2>&1
58 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
59 cp /tmp/csql.conf $CSQL_CONFIG_FILE
60 exit 3;
63 # unload the two tables from csql and remove entry from csqltable.conf
65 echo "Table t2 unloaded from CSQl"
66 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
67 if [ $? -ne 0 ]
68 then
69 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
70 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
72 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql >/dev/null 2>&1
73 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
75 cp /tmp/csql.conf $CSQL_CONFIG_FILE
76 exit 4;
79 $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -u >/dev/null 2>&1
80 if [ $? -ne 0 ]
81 then
82 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql >/dev/null 2>&1
83 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
84 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
86 cp /tmp/csql.conf $CSQL_CONFIG_FILE
87 exit 5;
90 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
91 isql $DSN <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
92 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
93 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
94 cp /tmp/csql.conf $CSQL_CONFIG_FILE
95 exit 0;