fixing compilation error
[csql.git] / test / cache / CacheTable / test029.ksh
blobdcf2af339674dc45c058dccc717576f11fd74d2b
1 #!/bin/sh
2 #Test Case
3 # Create table t5 and t6 in target DB
4 # Load t5 and t6 table without condition option with direct option
5 # Insert some record in CSQL tool as csql -g option it should insert into targert database not in CSQL database
8 input=${PWD}/cache/CacheTable/inputtest4.sql
9 REL_PATH=.
10 if [ -s "$input" ]
11 then
12 REL_PATH=${PWD}/cache/CacheTable
15 # create table t1,t2 in target DB.
16 isql myodbc3 < ${REL_PATH}/createt5.sql >/dev/null 2>&1
17 if [ $? -ne 0 ]
18 then
19 exit 1;
22 echo Table t1 and t2 created in target DB.
24 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
25 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
27 echo "cachetable -t t5 -D"
28 echo "cachetable -t t6 -D"
30 $CSQL_INSTALL_ROOT/bin/cachetable -t t5 -D
31 if [ $? -ne 0 ]
32 then
33 isql myodbc3 < ${REL_PATH}/drop5.sql >/dev/null 2>&1
34 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
35 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 exit 2;
39 $CSQL_INSTALL_ROOT/bin/cachetable -t t6 -D
40 if [ $? -ne 0 ]
41 then
42 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
43 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
44 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1
45 isql myodbc3 < ${REL_PATH}/drop5.sql >/dev/null 2>&1
46 exit 3;
49 for((a=5;a<=6;a++))
51 echo "insert into t$a values(15,20);"
52 echo "insert into t$a values(16,21);"
53 done>>${REL_PATH}/insertt5t6.sql
55 echo "select query on t1 and t2 table"
56 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/insertt5t6.sql
57 if [ $? -ne 0 ]
58 then
59 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
60 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
61 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1
62 isql myodbc3 < ${REL_PATH}/drop5.sql >/dev/null 2>&1
63 rm -f $REL_PATH/insertt5t6.sql
64 exit 4;
66 for((a=5;a<=6;a++))
68 echo "select * from t$a;"
69 done>>${REL_PATH}/selectt5t6.sql
71 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectt5t6.sql
72 if [ $? -ne 0 ]
73 then
74 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
75 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
76 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1
77 isql myodbc3 < ${REL_PATH}/drop5.sql >/dev/null 2>&1
78 rm -f $REL_PATH/insertt5t6.sql
79 rm -f $REL_PATH/selectt5t6.sql
80 exit 4;
82 isql myodbc3 < ${REL_PATH}/selectt5t6.sql
83 $CSQL_INSTALL_ROOT/bin/cachetable -t t6 -u
84 if [ $? -ne 0 ]
85 then
86 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
87 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
88 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1
89 isql myodbc3 < ${REL_PATH}/drop5.sql >/dev/null 2>&1
90 rm -f $REL_PATH/insertt5t6.sql
91 rm -f $REL_PATH/selectt5t6.sql
92 exit 5;
94 $CSQL_INSTALL_ROOT/bin/cachetable -t t5 -u
95 if [ $? -ne 0 ]
96 then
97 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
98 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
99 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1
100 isql myodbc3 < ${REL_PATH}/drop5.sql >/dev/null 2>&1
101 rm -f $REL_PATH/insertt5t6.sql
102 rm -f $REL_PATH/selectt5t6.sql
103 exit 6;
106 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
107 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
109 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop5.sql > /dev/null 2>&1
110 isql myodbc3 <${REL_PATH}/drop5.sql >/dev/null 2>&1
111 rm -f $REL_PATH/insertt5t6.sql
112 rm -f $REL_PATH/selectt5t6.sql
114 exit 0;