adding test scripts
[csql.git] / test / cache / CacheTable / test024.ksh
blobd601bd48dbb16b562f394ee57222cab6c649adac
1 #!/bin/ksh
2 #Test Case 24
3 # create table t1 and t2 in target db with 10 records
4 # load t1 table in csql with condition option and without field mode option.
5 # load table t2 with condition and field mode option.
6 # select from t2 table in CSQL and verify it displays only specified field
7 # values which satisfies the condition.
9 #Author : Jitendra Lenka
11 input=${PWD}/cache/CacheTable/
12 REL_PATH=.
13 if [ -s "$input" ]
14 then
15 REL_PATH=${PWD}/cache/CacheTable
17 rm -f /tmp/csql.conf
18 cp $CSQL_CONFIG_FILE /tmp
19 export CSQL_CONFIG_FILE=/tmp/csql.conf
20 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
21 echo DSN=$DSN >>$CSQL_CONFIG_FILE
22 DS="$DSN $DBUSER $PASSWORD"
23 rm -f /tmp/csql/csqlds.conf
24 touch /tmp/csql/csqlds.conf
25 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
26 if [ $? -ne 0 ]
27 then
28 exit 1;
31 isql $DS < ${REL_PATH}/fmodecreate.sql >/dev/null 2>&1
32 if [ $? -ne 0 ]
33 then
34 exit 1;
36 echo Table t1 and t2 created in target DB.
37 rm -f /tmp/csql/csqltable.conf
38 touch /tmp/csql/csqltable.conf
40 echo "cachetable -t t1 -c \"t1f1<5\" "
41 echo "cachetable -t t2 -c \"t2f1>15\" -f \"t2f1,t2f3,t2f5\" "
43 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "t1f1<5" >/dev/null 2>&1
44 if [ $? -ne 0 ]
45 then
46 isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
47 rm -f /tmp/csql/csqltable.conf
48 touch /tmp/csql/csqltable.conf
49 exit 2;
52 $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1>15" -f "t2f1,t2f3,t2f5"
53 if [ $? -ne 0 ]
54 then
55 rm -f /tmp/csql/csqltable.conf
56 touch /tmp/csql/csqltable.conf
57 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
58 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
59 exit 3;
62 echo "select query on t1 and t2 table"
63 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql
65 rm -f /tmp/csql/csqltable.conf
66 touch /tmp/csql/csqltable.conf
68 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
69 isql $DS <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
70 exit 0;