adding test scripts
[csql.git] / test / cache / CacheTable / test015.ksh
blobc03d18bdff3fe8da08a2589ca59037ee05c355db
1 #!/bin/ksh
2 #Test Case
3 #15. create table t1 and t2 in target DB with 10 records
4 # Load t1 table without condition option
5 # Load t2 with condition " t2f1 < 5 ".
6 # Select from t1, should show 10 records and t2 should show only 4 records
8 # Author : Jitendra Lenka
10 input=${PWD}/cache/CacheTable/inputtest4.sql
11 REL_PATH=.
12 if [ -s "$input" ]
13 then
14 REL_PATH=${PWD}/cache/CacheTable
17 cp $CSQL_CONFIG_FILE /tmp/csql.conf
18 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 DS="$DSN $DBUSER $PASSWORD"
21 rm -f /tmp/csql/csqlds.conf
22 touch /tmp/csql/csqlds.conf
23 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
24 if [ $? -ne 0 ]
25 then
26 cp /tmp/csql.conf $CSQL_CONFIG_FILE
27 exit 1;
30 # create table t1,t2 in target DB.
31 isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1
32 if [ $? -ne 0 ]
33 then
34 cp /tmp/csql.conf $CSQL_CONFIG_FILE
35 exit 1;
38 echo Table t1 and t2 created in target DB.
40 rm -f /tmp/csql/csqltable.conf
41 touch /tmp/csql/csqltable.conf
43 echo "cachetable -t t1"
44 echo "cachetable -t t2 -c \"t2f1<5\" "
46 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1
47 if [ $? -ne 0 ]
48 then
49 isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
50 rm -f /tmp/csql/csqltable.conf
51 cp /tmp/csql.conf $CSQL_CONFIG_FILE
52 exit 2;
55 $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1<5"
56 if [ $? -ne 0 ]
57 then
58 rm -f /tmp/csql/csqltable.conf
59 touch /tmp/csql/csqltable.conf
60 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
61 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
62 cp /tmp/csql.conf $CSQL_CONFIG_FILE
63 exit 3;
67 echo "select query on t1 and t2 table"
68 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql
70 rm -f /tmp/csql/csqltable.conf
71 touch /tmp/csql/csqltable.conf
73 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
74 isql $DS <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
75 cp /tmp/csql.conf $CSQL_CONFIG_FILE
76 exit 0;