*** empty log message ***
[csql.git] / test / cache / CacheTable / test026.ksh
blob91aab3685a5bcde3c56e1c23fc161a8a570ddf43
1 #!/bin/ksh
2 #Test case 26.
3 # create table t1 and t2in target DB with 10 records.
4 # Recover the two tables from target db with -R option.
5 # The contains in the csqltable.conf file will be like this :
6 # 1:t1 NULL NULL
7 # 2:t2 t2f1<15 t2f1,t2f3,t2f5
9 #AUTHOR : Jitendra Lenka
10 input=${PWD}/cache/CacheTable/
11 REL_PATH=.
12 if [ -s "$input" ]
13 then
14 REL_PATH=${PWD}/cache/CacheTable
16 rm -f /tmp/csql.conf
17 cp $CSQL_CONFIG_FILE /tmp
18 export CSQL_CONFIG_FILE=/tmp/csql.conf
20 # create table t1,t2 in target DB.
21 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
22 echo DSN=$DSN >>$CSQL_CONFIG_FILE
23 DS="$DSN $DBUSER $PASSWORD"
24 rm -f /tmp/csql/csqlds.conf
25 touch /tmp/csql/csqlds.conf
26 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
27 if [ $? -ne 0 ]
28 then
29 exit 1;
32 isql $DS < ${REL_PATH}/fmodecreate.sql >/dev/null 2>&1
33 if [ $? -ne 0 ]
34 then
35 exit 1;
38 echo Table t1 and t2 created in target DB.
40 rm -f /tmp/csql/csqltable.conf
41 touch /tmp/csql/csqltable.conf
43 echo "1 t1 NULL NULL NULL $DSN" >/tmp/csql/csqltable.conf
44 echo "2 t2 NULL t2f1<15 t2f1,t2f3,t2f5 $DSN" >>/tmp/csql/csqltable.conf
46 # caching with -R option
47 $CSQL_INSTALL_ROOT/bin/cachetable -R
48 if [ $? -ne 0 ]
49 then exit 2;
52 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql
53 if [ $? -ne 0 ]
54 then
55 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
56 isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
57 rm -f /tmp/csql/csqltable.conf
58 touch /tmp/csql/csqltable.conf
59 exit 3;
62 rm -f /tmp/csql/csqltable.conf
63 touch /tmp/csql/csqltable.conf
64 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
65 isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
67 exit 0;