64 bit build fix
[csql.git] / test / cache / CacheVerify / test008.ksh
blob8e970672e5e34d5de7c824798be60f23815ac48b
1 #!/bin/ksh
2 # Test Case
4 # 8. For the previous scenario update 2 rows in csql and update 2 rows in mysql with different primary keys.
5 # Run $ cacheverify -t t1.
6 # The output should display number of records as 7 and 8 for csql
7 # and mysql respectively.
8 # Run $ cacheverify -t t1 -p.
9 # The output should display the primary key field values for missing
10 # records in either of the databases in ascending order.
11 # Run $ cacheverify -t t1 -f.
12 # The output should display the 4 inconsistent records. Only those
13 # fields with different values should be displayed for inconsistent
14 # records.
16 #Run this test only under csql/test or on this directory.
17 #Otherwise, it may fail
19 input=${PWD}/cache/CacheVerify/csqlupdate.sql
20 REL_PATH=.
21 if [ -s "$input" ]
22 then
23 REL_PATH=${PWD}/cache/CacheVerify
26 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlupdate.sql >/dev/null 2>&1
27 if [ $? -ne 0 ]
28 then
29 exit 1;
32 cp $CSQL_CONFIG_FILE /tmp/csql.conf
33 export CSQL_CONFIG_FILE=/tmp/csql.conf
34 echo DSN=$DSN >>$CSQL_CONFIG_FILE
35 DS="$DSN $DBUSER $PASSWORD"
36 rm -f /tmp/csql/csqlds.conf
37 touch /tmp/csql/csqlds.conf
38 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
39 if [ $? -ne 0 ]
40 then
41 exit 1;
44 if [ $DSN = "oracle" ]
45 then
46 isql $DS < ${REL_PATH}/oracleupdate.sql >/dev/null 2>&1
47 if [ $? -ne 0 ]
48 then
49 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
50 exit 2;
52 else
53 if [ $DSN = "db2" ]
54 then
55 isql $DS < ${REL_PATH}/db2update.sql >/dev/null 2>&1
56 if [ $? -ne 0 ]
57 then
58 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
59 exit 2;
61 else
62 isql $DS < ${REL_PATH}/mysqlupdate.sql >/dev/null 2>&1
63 if [ $? -ne 0 ]
64 then
65 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
66 exit 2;
71 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
72 if [ $? -ne 0 ]
73 then
74 rm -f /tmp/csql/csqltable.conf
75 touch /tmp/csql/csqltable.conf
76 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
77 exit 3;
80 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
81 if [ $? -ne 0 ]
82 then
83 rm -f /tmp/csql/csqltable.conf
84 touch /tmp/csql/csqltable.conf
85 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
86 exit 4;
89 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
90 if [ $? -ne 0 ]
91 then
92 rm -f /tmp/csql/csqltable.conf
93 touch /tmp/csql/csqltable.conf
94 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
95 exit 5;
98 rm -f /tmp/csql/csqltable.conf
99 touch /tmp/csql/csqltable.conf
100 isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1
101 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
103 exit 0;