*** empty log message ***
[csql.git] / test / cache / CacheTable / test024.ksh
blob3843b12c325c6e4cc5cc537f4530d9235a064a03
1 #!/bin/sh
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 both the table
8 #Run the test only under csql/test or on this directory.
9 #otherwise it may fail.
11 #Author : Jitendra Lenka
13 input=${PWD}/cache/CacheTable/
14 REL_PATH=.
15 if [ -s "$input" ]
16 then
17 REL_PATH=${PWD}/cache/CacheTable
19 isql myodbc3 < ${REL_PATH}/fmodecreate.sql >/dev/null 2>&1
20 if [ $? -ne 0 ]
21 then
22 exit 1;
24 echo Table t1 and t2 created in target DB.
25 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
26 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
28 echo "cachetable -t t1 -c \"t1f1<5\" "
29 echo "cachetable -t t2 -c \"t2f1>15\" -f \"t2f1,t2f3,t2f5\" "
31 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "t1f1<5" >/dev/null 2>&1
32 if [ $? -ne 0 ]
33 then
34 isql myodbc3 < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
35 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
37 exit 2;
40 $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1>15" -f "t2f1,t2f3,t2f5"
41 if [ $? -ne 0 ]
42 then
43 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
44 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
45 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
46 isql myodbc3 < ${REL_PATH}/drop.sql >/dev/null 2>&1
47 exit 3;
50 echo "select query on t1 and t2 table"
51 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql
53 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
54 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
56 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1
57 isql myodbc3 <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1
58 exit 0;