common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / CacheTable / test026.ksh
blobc8f579ca0f1034a685daa28b94bc99e3f92f1b47
1 #!/bin/sh
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 :
7 # 1:t1 NULL NULL
8 # 2:t2 t2f1<15 t2f1,t2f3,t2f5
10 #Run this test only under csql/test or on this directory
11 #otherwise it may fail.
13 #AUTHOR : Jitendra Lenka
14 input=${PWD}/cache/CacheTable/
15 REL_PATH=.
16 if [ -s "$input" ]
17 then
18 REL_PATH=${PWD}/cache/CacheTable
21 # create table t1,t2 in target DB.
22 isql $DSN < ${REL_PATH}/fmodecreate.sql >/dev/null 2>&1
23 if [ $? -ne 0 ]
24 then
25 exit 1;
28 echo Table t1 and t2 created in target DB.
30 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
31 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
33 echo "1:t1 NULL NULL NULL" >/tmp/csql/csqltable.conf
34 echo "2:t2 NULL t2f1<15 t2f1,t2f3,t2f5" >>/tmp/csql/csqltable.conf
36 # caching with -R option
37 $CSQL_INSTALL_ROOT/bin/cachetable -R
38 if [ $? -ne 0 ]
39 then exit 2;
42 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql
43 if [ $? -ne 0 ]
44 then
45 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
46 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
47 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
48 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
49 exit 3;
52 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
53 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
54 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
55 isql $DSN < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
57 exit 0;