*** empty log message ***
[csql.git] / test / cache / CacheTable / test017.ksh
blob81b74303649221fa8fa3e58e8dc5bec86369760f
1 #!/bin/sh
2 #Test Case
3 #17. Create table t1 and t2 in target DB with 10 records.
4 # Recover the two tables from the target DB with -R option,
5 # as per the csqltable.conf file.
6 # the contains in csqltable.conf file is:
7 # 1:t1 NULL
8 # 2:t2 t2f1<5
10 #Run this test only under csql/test or on this directory
11 #otherwise it may fail.
13 #AUTHOR : Jitendra Lenka
15 input=${PWD}/cache/CacheTable/inputtest4.sql
16 REL_PATH=.
17 if [ -s "$input" ]
18 then
19 REL_PATH=${PWD}/cache/CacheTable
22 cp $CSQL_CONFIG_FILE /tmp/csql.conf
23 echo DSN=$DSN >>$CSQL_CONFIG_FILE
24 # create table t1,t2 in target DB.
25 isql $DSN < ${REL_PATH}/create.sql >/dev/null 2>&1
26 if [ $? -ne 0 ]
27 then
28 cp /tmp/csql.conf $CSQL_CONFIG_FILE
29 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
37 echo "1:t1 NULL NULL NULL" > /tmp/csql/csqltable.conf
38 echo "2:t2 NULL t2f1<5 NULL" >> /tmp/csql/csqltable.conf
42 # caching with -R option
43 $CSQL_INSTALL_ROOT/bin/cachetable -R
44 if [ $? -ne 0 ]
45 then
46 cp /tmp/csql.conf $CSQL_CONFIG_FILE
47 exit 2;
50 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql
51 if [ $? -ne 0 ]
52 then
53 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
54 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
55 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
56 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
57 cp /tmp/csql.conf $CSQL_CONFIG_FILE
58 exit 3;
61 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
62 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
63 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
64 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
66 cp /tmp/csql.conf $CSQL_CONFIG_FILE
67 exit 0;