3 #cacheverify test after all Non-select dml (primary key on char field) (cache/CacheVerify/test010.ksh)
4 #Create table t1 in mysql with primary key on char field. Insert 5 rows.
5 #Cache the table in csql.
6 #Run $ cacheverify -t t1. The output should display the number of records present in csql and mysql same.
7 #Run $ cacheverify -t t1 -p. The output should display no missing records in either database.
8 #Run $ cacheverify -t t1 -f. The output should display no missing records and should display the data is consistent in both databases.
9 #Update 2 records in csql using csql -g.
10 #Run $ cacheverify -t t1 -f
11 #The output should display no missing records and should display the data is consistent in both databases.
12 #delete 2 records in csql using csql -g.
13 #Run $ cacheverify -t t1 -p
14 #The output should display no missing records in either database.
15 #Update 2 records in Mysql.
16 #Run $ cacheverify -t t1 -f.
17 #The output should display the 4 inconsistent records. Only those fields with different values should be displayed for inconsistent records.
18 #delete 2 records in Mysql.
19 #Run $ cacheverify -t t1 -p.
20 #The output should display the primary key field values for missing records in either of the databases in ascending order.
22 input
=${PWD}/cache
/CacheVerify
/mysqlinput10.sql
26 REL_PATH
=${PWD}/cache
/CacheVerify
29 rm -f /tmp
/csql
/csqltable.conf
30 touch /tmp
/csql
/csqltable.conf
32 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
33 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
34 echo CACHE_TABLE
=true
>>$CSQL_CONFIG_FILE
35 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
36 DS
="$DSN $DBUSER $PASSWORD"
37 rm -f /tmp
/csql
/csqlds.conf
38 touch /tmp
/csql
/csqlds.conf
39 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
45 if [ $DSN = "myodbc3" ]
47 isql
$DS < ${REL_PATH}/mysqlinput13.sql
>/dev
/null
2>&1
48 elif [ $DSN = "oracle" ]
50 isql
$DS < ${REL_PATH}/oracleinput13.sql
>/dev
/null
2>&1
51 elif [ $DSN = "sybase" ]
53 isql
$DS < ${REL_PATH}/sybaseinput13.sql
>/dev
/null
2>&1
56 isql
$DS < ${REL_PATH}/db2input13.sql
>/dev
/null
2>&1
58 isql
$DS < ${REL_PATH}/psqlinput13.sql
>/dev
/null
2>&1
62 rm -f /tmp
/csql
/csqltable.conf
63 touch /tmp
/csql
/csqltable.conf
64 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
67 rm -f /tmp
/csql
/csqltable.conf
68 touch /tmp
/csql
/csqltable.conf
72 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
75 rm -f /tmp
/csql
/csqltable.conf
76 touch /tmp
/csql
/csqltable.conf
77 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
78 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
83 echo cacheverify
-t t1
84 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
87 rm -f /tmp
/csql
/csqltable.conf
88 touch /tmp
/csql
/csqltable.conf
89 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
90 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
94 echo cacheverify
-t t1
-p
95 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
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
105 echo cacheverify
-t t1
-f
106 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
109 rm -f /tmp
/csql
/csqltable.conf
110 touch /tmp
/csql
/csqltable.conf
111 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
112 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
116 echo updating
2 records
in csql through gateway
117 $CSQL_INSTALL_ROOT/bin
/csql
-g -s ${REL_PATH}/csqlupd.sql
>/dev
/null
2>&1
120 rm -f /tmp
/csql
/csqltable.conf
121 touch /tmp
/csql
/csqltable.conf
122 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
123 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
127 echo cacheverify
-t t1
-f
128 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
131 rm -f /tmp
/csql
/csqltable.conf
132 touch /tmp
/csql
/csqltable.conf
133 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
134 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
138 echo deleting
2 records
in csql through gateway
139 $CSQL_INSTALL_ROOT/bin
/csql
-g -s ${REL_PATH}/csqldel.sql
>/dev
/null
2>&1
142 rm -f /tmp
/csql
/csqltable.conf
143 touch /tmp
/csql
/csqltable.conf
144 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
145 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
149 echo cacheverify
-t t1
-p
150 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
153 rm -f /tmp
/csql
/csqltable.conf
154 touch /tmp
/csql
/csqltable.conf
155 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
156 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
160 echo updating
2 records
in mysql
161 isql
$DS < ${REL_PATH}/mysqlupd.sql
>/dev
/null
2>&1
164 rm -f /tmp
/csql
/csqltable.conf
165 touch /tmp
/csql
/csqltable.conf
166 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
167 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
171 echo cacheverify
-t t1
-f
172 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
175 rm -f /tmp
/csql
/csqltable.conf
176 touch /tmp
/csql
/csqltable.conf
177 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
178 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
182 echo deleting
2 records
in mysql
183 isql
$DS < ${REL_PATH}/mysqldel.sql
>/dev
/null
2>&1
186 rm -f /tmp
/csql
/csqltable.conf
187 touch /tmp
/csql
/csqltable.conf
188 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
189 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
193 echo cacheverify
-t t1
-p
194 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
197 rm -f /tmp
/csql
/csqltable.conf
198 touch /tmp
/csql
/csqltable.conf
199 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
200 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
204 rm -f /tmp
/csql
/csqltable.conf
205 touch /tmp
/csql
/csqltable.conf
206 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
207 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1