code reorg for Transactionw!
[csql.git] / test / cache / CacheVerify / test005.ksh
blob7dbe620ac129785df61a47f75fd883f532f4f8e9
1 #!/bin/ksh
2 # Test Case
3 # 5. Create table t1 with primary key in csql.
4 # Make sure that t1 is not present in mysql and
5 # csqltable.conf file does not have any entry for t1.
6 # run $ cacheverify -t t1.
7 # It should give an error saying table t1 is not cached.
9 #Run this test only under csql/test or on this directory.
10 #Otherwise, it may fail
12 input=${PWD}/cache/CacheVerify/mysqlinput.sql
13 REL_PATH=.
14 if [ -s "$input" ]
15 then
16 REL_PATH=${PWD}/cache/CacheVerify
18 cp $CSQL_CONFIG_FILE /tmp/csql.conf
19 export CSQL_CONFIG_FILE=/tmp/csql.conf
20 echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE
21 echo DSN=$DSN >>$CSQL_CONFIG_FILE
22 DS="$DSN $DBUSER $PASSWORD"
23 rm -f /tmp/csql/csqlds.conf
24 touch /tmp/csql/csqlds.conf
25 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
26 if [ $? -ne 0 ]
27 then
28 exit 1;
31 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1
32 if [ $? -ne 0 ]
33 then
34 exit 1;
37 rm -f /tmp/csql/csqltable.conf
38 touch /tmp/csql/csqltable.conf
40 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
41 if [ $? -ne 5 ]
42 then
43 exit 2;
46 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql >/dev/null 2>&1
47 exit 0;