*** empty log message ***
[csql.git] / test / cache / CacheTable / test018.ksh
blobad722c95a34539823cd4bb5f214025920111735f
1 #!/bin/sh
2 #Test Case
4 #18. load t1 table with records in target DB,
5 # create a t1 table in CSQL without record.
6 # load with -s option, it should pass.
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 DSN=$DSN >>$CSQL_CONFIG_FILE
19 isql $DSN < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
21 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlinput.sql > /dev/null 2>&1
22 if [ $? -ne 0 ]
23 then
24 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
25 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
26 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
27 cp /tmp/csql.conf $CSQL_CONFIG_FILE
28 exit 2;
31 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
32 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
34 # caching with -s option
35 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1
36 if [ $? -ne 0 ]
37 then
38 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
39 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
40 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
41 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
42 cp /tmp/csql.conf $CSQL_CONFIG_FILE
43 exit 3;
46 echo "select * from t1;"
47 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/selectt1.sql
48 if [ $? -ne 0 ]
49 then
50 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
51 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
52 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
53 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
54 cp /tmp/csql.conf $CSQL_CONFIG_FILE
55 exit 4;
57 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
58 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
61 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
62 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
63 cp /tmp/csql.conf $CSQL_CONFIG_FILE
64 exit 0;