fixing compilation error
[csql.git] / test / cache / CacheTable / test014.ksh
blob9afd8fcd8074145b917b97fa7bf17f6808c497cf
1 #!/bin/sh
2 # Test Case
3 #14. Create 't1' table in Target DB with two records,
4 # Load selected records into CSQL with -c "f1=1" option.
5 # select query executes the selected records from CSQL.
7 #Run this only under csql/test or on this directory, Otherwise it will fail.
9 # Author : Jitendra Lenka
11 input=${PWD}/cache/CacheTable/inputtest4.sql
12 REL_PATH=.
13 if [ -s "$input" ]
14 then
15 REL_PATH=${PWD}/cache/CacheTable
18 cp $CSQL_CONFIG_FILE /tmp/csql.conf
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 isql $DSN < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
21 if [ $? -ne 0 ]
22 then
23 cp /tmp/csql.conf $CSQL_CONFIG_FILE
24 exit 1;
27 echo Table t1 created with two records in target db.
29 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
30 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
32 #cache from target to csql with -c option
33 echo "cachetable -t t1 -c \"f1=1\" "
34 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1=1" >/dev/null 2>&1
35 if [ $? -ne 0 ]
36 then
37 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
38 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 2;
46 echo "select * from t1;"
47 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql
49 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
50 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
55 cp /tmp/csql.conf $CSQL_CONFIG_FILE
56 exit 0;