*** empty log message ***
[csql.git] / test / cache / CacheVerify / test009.ksh
blobc996fbee425cf4cbee61ebfa815d6e15a213989a
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 cp $CSQL_CONFIG_FILE /tmp/csql.conf
28 echo DSN=$DSN >>$CSQL_CONFIG_FILE
29 isql $DSN < ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1
30 if [ $? -ne 0 ]
31 then
32 cp /tmp/csql.conf $CSQL_CONFIG_FILE
33 exit 1;
36 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/mysqlinput.sql >/dev/null 2>&1
37 if [ $? -ne 0 ]
38 then
39 cp /tmp/csql.conf $CSQL_CONFIG_FILE
40 exit 2;
43 echo "1:t1 NULL NULL NULL" > /tmp/csql/csqltable.conf
44 isql $DSN < ${REL_PATH}/mysqlupdate.sql >/dev/null 2>&1
45 if [ $? -ne 0 ]
46 then
47 cp /tmp/csql.conf $CSQL_CONFIG_FILE
48 exit 3;
52 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlupdate.sql >/dev/null 2>&1
53 if [ $? -ne 0 ]
54 then
55 cp /tmp/csql.conf $CSQL_CONFIG_FILE
56 exit 4;
59 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
60 if [ $? -ne 0 ]
61 then
62 cp /tmp/csql.conf $CSQL_CONFIG_FILE
63 exit 5;
66 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
67 if [ $? -ne 0 ]
68 then
69 cp /tmp/csql.conf $CSQL_CONFIG_FILE
70 exit 6;
73 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
74 if [ $? -ne 0 ]
75 then
76 cp /tmp/csql.conf $CSQL_CONFIG_FILE
77 exit 7;
80 rm -f /tmp/csql/csqltable.conf
81 touch /tmp/csql/csqltable.conf
82 isql $DSN < $REL_PATH/drop.sql >/dev/null 2>&1
83 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
85 cp /tmp/csql.conf $CSQL_CONFIG_FILE
86 exit 0;