*** empty log message ***
[csql.git] / test / cache / CacheVerify / test004.ksh
blobc67bbb1fa304102f5108920228a29cf0ea9152b9
1 #!/bin/sh
2 # Test Case
3 # 4. Create a table t1 with no primary key in mysql. and insert 2 tuples.
4 # Cache the table in csql.
5 # Run $ cacheverify -t t1.
6 # It should display number of records for csql and mysql respectively.
7 # Run $ cacheverify -t t1 -p.
8 # It should give an error saying no primary key is present on table t1.
9 # Run $ cacheverify -t t1 -f.
10 # It should give an error saying no primary key is present on table t1.
12 #Run this test only under csql/test or on this directory.
13 #Otherwise, it may fail
15 input=${PWD}/cache/CacheVerify/inputtest4.sql
16 REL_PATH=.
17 if [ -s "$input" ]
18 then
19 REL_PATH=${PWD}/cache/CacheVerify
22 cp $CSQL_CONFIG_FILE /tmp/csql.conf
23 echo DSN=$DSN >>$CSQL_CONFIG_FILE
24 isql $DSN < ${REL_PATH}/inputtest4.sql > /dev/null 2>&1
25 #$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/inputtest4.sql > /dev/null 2>&1
26 if [ $? -ne 0 ]
27 then
28 cp /tmp/csql.conf $CSQL_CONFIG_FILE
29 exit 1;
32 rm -f /tmp/csql/csqltable.conf
33 touch /tmp/csql/csqltable.conf
34 echo "1:t1 NULL NULL NULL" >/tmp/csql/csqltable.conf
36 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -R>/dev/null 2>&1
37 if [ $? -ne 0 ]
38 then
39 cp /tmp/csql.conf $CSQL_CONFIG_FILE
40 exit 2;
43 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
44 if [ $? -ne 0 ]
45 then
46 cp /tmp/csql.conf $CSQL_CONFIG_FILE
47 exit 3;
50 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
51 if [ $? -eq 0 ]
52 then
53 cp /tmp/csql.conf $CSQL_CONFIG_FILE
54 exit 4;
57 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
58 if [ $? -eq 0 ]
59 then
60 cp /tmp/csql.conf $CSQL_CONFIG_FILE
61 exit 5;
64 rm -f /tmp/csql/csqltable.conf
65 touch /tmp/csql/csqltable.conf
66 isql $DSN < ${REL_PATH}/drop.sql > /dev/null 2>&1
67 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1
69 cp /tmp/csql.conf $CSQL_CONFIG_FILE
70 exit 0;