3 # 5. Cached table there in csql, but complex query (avg on some field). It should get the correct value from mysql.
5 #Run this test only under csql/test or on this directory.
6 #Otherwise, it may fail
7 input
=${PWD}/cache
/Gateway
/mysqlinputtest1.sql
11 REL_PATH
=${PWD}/cache
/Gateway
15 cp $REL_PATH/csql.conf
/tmp
/csql.conf
16 echo CSQL_SQL_SERVER
=true
>>/tmp
/csql.conf
17 echo PORT
=6008 >>/tmp
/csql.conf
18 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
20 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
21 DS
="$DSN $DBUSER $PASSWORD"
22 rm -f /tmp
/csql
/csqlds.conf
23 touch /tmp
/csql
/csqlds.conf
24 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
30 if [ $DSN = "oracle" ]
32 isql
$DS < $REL_PATH/orainputt1.oracle
>/dev
/null
2>&1
33 elif [ $DSN = "sybase" ]
35 isql
$DS < $REL_PATH/sybaseinputtest1.sql
>/dev
/null
2>&1
38 isql
$DS < $REL_PATH/db2inputtest1.sql
>/dev
/null
2>&1
40 isql
$DS < $REL_PATH/mysqlinputtest1.sql
>/dev
/null
2>&1
45 echo "DSN is not set for target db"
49 # edit /tmp/csql/csqltable.conf
50 rm -f /tmp
/csql
/csqltable.conf
51 touch /tmp
/csql
/csqltable.conf
52 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
57 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-d $DSN
64 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6008 -g -s $REL_PATH/selectstar.sql
67 echo "Unable to start server"
71 if [ $DSN = "oracle" ]
73 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6008 -g -s $REL_PATH/complex.oracle
74 elif [ $DSN = "sybase" -o $DSN = "db2" ]
76 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6008 -g -s $REL_PATH/complex.sybase
78 $CSQL_INSTALL_ROOT/bin
/csql
-H localhost
-P 6008 -g -s $REL_PATH/complex.sql
81 isql
$DS < $REL_PATH/dropt1t2t3.sql
> /dev
/null
2>&1
82 rm -f /tmp
/csql
/csqltable.conf
83 touch /tmp
/csql
/csqltable.conf
86 kill `ps -el | grep csqlsqlserver | gawk -F" " '{ print $4 }'`