test script corresponding to the cases in Wiki pages for the module
[csql.git] / test / cache / Gateway / test005.ksh
blob0c9fcac3df29c9fef3c8b10483c19b50b471fdcf
1 #!/bin/sh
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 CSQL_CONF=${PWD}/cache/Gateway/csql.conf
8 input=${PWD}/cache/Gateway/mysqlinputtest1.sql
9 REL_PATH=.
10 if [ -s "$input" -a -s "$CSQL_CONF" ]
11 then
12 REL_PATH=${PWD}/cache/Gateway
14 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
16 isql myodbc3 < $REL_PATH/mysqlinputtest5.sql > /dev/null 2>&1
18 # edit /tmp/csql/csqltable.conf
19 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
20 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
21 for (( a=1; a<2; a++ ))
23 echo "1:t$a"
24 done >> /tmp/csql/csqltable.conf
25 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
26 pid=$!
27 sleep 5
28 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
29 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/complex.sql
30 isql myodbc3 < $REL_PATH/dropall.sql > /dev/null 2>&1
31 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
32 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
33 kill -9 $pid
34 ipcrm -M 1199 -M 2277
35 exit 0;