separating database engine and cache tests
[csql.git] / test / cache / CacheTable / test020.ksh
bloba59ac5462e3b17625d603a4f802cc7a71f706f94
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 isql $DSN < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
19 if [ $? -ne 0 ]
20 then
21 exit 1;
24 rm -f /tmp/csql/csqltable.conf /tmp/csql.db
25 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
27 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
28 if [ $? -ne 0 ]
29 then
30 exit 2;
33 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql >/dev/null 2>&1
34 if [ $? -ne 0 ]
35 then
36 exit 3;
38 echo "cache table 't1' can't be dropped"
40 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql
41 if [ $? -ne 0 ]
42 then
43 exit 4;
46 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1
47 if [ $? -ne 0 ]
48 then
49 exit 4;
52 echo "cache table 't1' unloaded by -u option"
53 rm -f /tmp/csql/csqltable.conf /tmp/csql.db
54 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
55 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
56 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
57 exit 0;