*** empty log message ***
[csql.git] / test / cache / CacheTable / test028.ksh
blobbd81ca04d9f0867e189cd3b421b6918a2c753fdf
1 #!/bin/ksh
2 #Test case 28.
3 # create table t1 with records in target DB.
4 # create a table with the same schema in csql .
5 # load with -s option. it should pass.
7 #AUTHOR : Jitendra Lenka
9 input=${PWD}/cache/CacheTable/
10 REL_PATH=.
11 if [ -s "$input" ]
12 then
13 REL_PATH=${PWD}/cache/CacheTable
15 rm -f /tmp/csql.conf
16 cp $CSQL_CONFIG_FILE /tmp
17 export 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 exit 1;
29 isql $DS < ${REL_PATH}/fmodeinsert.sql >/dev/null 2>&1
30 if [ "$DSN" = "oracle" ]
31 then
32 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/fcsqlinputoracle.sql > /dev/null 2>&1
33 else
34 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/fcsqlinput.sql > /dev/null 2>&1
36 if [ $? -ne 0 ]
37 then
38 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
39 rm -f /tmp/csql/csqltable.conf
40 touch /tmp/csql/csqltable.conf
41 exit 1;
44 rm -f /tmp/csql/csqltable.conf
45 touch /tmp/csql/csqltable.conf
47 # caching with -s option
48 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1
49 if [ $? -ne 0 ]
50 then
51 rm -f /tmp/csql/csqltable.conf
52 touch /tmp/csql/csqltable.conf
53 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
54 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
55 exit 3;
58 echo "select * from t1;"
59 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/selectt1.sql
60 if [ $? -ne 0 ]
61 then
62 rm -f /tmp/csql/csqltable.conf
63 touch /tmp/csql/csqltable.conf
64 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
65 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
66 exit 4;
69 rm -f /tmp/csql/csqltable.conf
70 touch /tmp/csql/csqltable.conf
73 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
74 isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1
75 exit 0;