*** empty log message ***
[csql.git] / test / cache / CacheTable / test020.ksh
blobbebccaef28eb842c701d1d0b92b1f1df602ef7f0
1 #!/bin/sh
3 # Create 't1' table with two records in target DB. \
4 # cache t1 from target to csql.
5 # table 't1' can't be deleted by DROP statement.
6 # it should be unloaded by -u option
8 # AUTHOR : Jitendra Lenka
10 #!/bin/sh
11 input=${PWD}/cache/CacheTable/inputtest4.sql
12 REL_PATH=.
13 if [ -s "$input" ]
14 then
15 REL_PATH=${PWD}/cache/CacheTable
18 cp $CSQL_CONFIG_FILE /tmp/csql.conf
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 isql $DSN < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
21 if [ $? -ne 0 ]
22 then
23 cp /tmp/csql.conf $CSQL_CONFIG_FILE
24 exit 1;
26 rm -f /tmp/csql/csqltable.conf /tmp/csql.db
27 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
29 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
30 if [ $? -ne 0 ]
31 then
32 cp /tmp/csql.conf $CSQL_CONFIG_FILE
33 exit 2;
36 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql >/dev/null 2>&1
37 if [ $? -ne 0 ]
38 then
39 cp /tmp/csql.conf $CSQL_CONFIG_FILE
40 exit 3;
42 echo "cache table 't1' can't be dropped"
44 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql
45 if [ $? -ne 0 ]
46 then
47 cp /tmp/csql.conf $CSQL_CONFIG_FILE
48 exit 4;
50 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
52 if [ $? -ne 0 ]
53 then
54 cp /tmp/csql.conf $CSQL_CONFIG_FILE
55 exit 4;
58 echo "cache table 't1' unloaded by -u option"
59 rm -f /tmp/csql/csqltable.conf /tmp/csql.db
60 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
61 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
62 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
63 cp /tmp/csql.conf $CSQL_CONFIG_FILE
64 exit 0;