separating database engine and cache tests
[csql.git] / test / cache / CacheVerify / test009.ksh
blob228392d4cd5593eb25c61e2868c952ae72b64de9
1 #!/bin/sh
2 # Test Case
3 # 9. Create table t1 in mysql with primary key. Insert 10 rows.
4 # Cache the table in csql.
5 # Update 2 rows in csql and 2 rows in mysql with different primary keys.
6 # Run $ cacheverify -t t1.
7 # The output should display number of records as 10 for both csql and
8 # mysql respectively.
9 # Run $ cacheverify -t t1 -p.
10 # The output should display no missing records in either of the
11 # databases.
12 # Run $ cacheverify -t t1 -f.
13 # The output should display the 4 inconsistent records.
14 # Only those fields with different values should be displayed
15 # for inconsistent records.
17 #Run this test only under csql/test or on this directory.
18 #Otherwise, it may fail
20 input=${PWD}/cache/CacheVerify/mysqlinput.sql
21 REL_PATH=.
22 if [ -s "$input" ]
23 then
24 REL_PATH=${PWD}/cache/CacheVerify
27 isql $DSN < ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1
28 if [ $? -ne 0 ]
29 then
30 exit 1;
33 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/mysqlinput.sql >/dev/null 2>&1
34 if [ $? -ne 0 ]
35 then
36 exit 2;
39 echo "1:t1 NULL" > /tmp/csql/csqltable.conf
40 isql $DSN < ${REL_PATH}/mysqlupdate.sql >/dev/null 2>&1
41 if [ $? -ne 0 ]
42 then
43 exit 3;
47 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlupdate.sql >/dev/null 2>&1
48 if [ $? -ne 0 ]
49 then
50 exit 4;
53 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
54 if [ $? -ne 0 ]
55 then
56 exit 5;
59 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
60 if [ $? -ne 0 ]
61 then
62 exit 6;
65 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
66 if [ $? -ne 0 ]
67 then
68 exit 7;
71 rm -f /tmp/csql/csqltable.conf
72 touch /tmp/csql/csqltable.conf
73 isql $DSN < $REL_PATH/drop.sql >/dev/null 2>&1
74 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
76 exit 0;