common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / CacheTable / test037.ksh
blob4f02807e77830887bb8be7a15b04007782e7c55c
1 #!/bin/sh
2 # Test Case
4 # Bi-directional cache test
5 # Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint . Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f1,f2,f3 -p f1 it should pass
7 # Author:=bijaya
10 input=${PWD}/cache/CacheTable/csql1.conf
12 REL_PATH=.
13 if [ -s "$input" ]
14 then
15 REL_PATH=${PWD}/cache/CacheTable
17 rm -f /tmp/csql1.conf
18 cp $REL_PATH/csql1.conf /tmp
19 export CSQL_CONFIG_FILE=/tmp/csql1.conf
20 echo DSN=$DSN >>$CSQL_CONFIG_FILE
21 echo "create table t1(f1 int unique,f2 char(12),f3 smallint , f4 bigint);">$REL_PATH/t1.sql
22 for((a=1;a<10;a++))
24 echo "insert into t1 values($a,'papu',12,$a+123124);"
25 done>>t1.sql
26 isql $DSN < $REL_PATH/t1.sql >/dev/null 2>&1
27 if [ $? -ne 0 ]
28 then
29 echo "unable to creste in target db"
30 rm -f $REL_PATH/t1.sql
31 exit 1
34 echo "drop table t1;">${REL_PATH}/dt1.sql
35 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
38 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
39 pid=$!
40 sleep 5
41 echo "server started"
42 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -p f1
43 if [ $? -ne 0 ]
44 then
45 echo "Unable to cache"
46 isql $DSN <${REL_PATH}/dt1.sql >/dev/null 2>&1
47 rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql
48 kill -2 $pid
49 ipcrm -M 4000 -M 4500
50 exit 2
52 isql $DSN <${REL_PATH}/dt1.sql >/dev/null 2>&1
53 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
54 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
55 rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql
56 kill -2 $pid
57 ipcrm -M 4000 -M 4500
58 exit 0;