3 #cacheverify test after all Non-select dml (primary key on tinyint field) (cache/CacheVerify/test010.ksh)
4 #Create table t1 in mysql with primary key on tinyint 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}/mysqlinput10.sql
>/dev
/null
2>&1
48 elif [ $DSN = "oracle" ]
50 isql
$DS < ${REL_PATH}/oracleinput10.sql
>/dev
/null
2>&1
51 elif [ $DSN = "sybase" ]
53 isql
$DS < ${REL_PATH}/sybaseinput10.sql
>/dev
/null
2>&1
56 isql
$DS < ${REL_PATH}/db2input10.sql
>/dev
/null
2>&1
58 isql
$DS < ${REL_PATH}/psqlinput10.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
71 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
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 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
82 echo cacheverify
-t t1
83 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
86 rm -f /tmp
/csql
/csqltable.conf
87 touch /tmp
/csql
/csqltable.conf
88 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
89 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
93 echo cacheverify
-t t1
-p
94 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
97 rm -f /tmp
/csql
/csqltable.conf
98 touch /tmp
/csql
/csqltable.conf
99 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
100 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
104 echo cacheverify
-t t1
-f
105 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
108 rm -f /tmp
/csql
/csqltable.conf
109 touch /tmp
/csql
/csqltable.conf
110 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
111 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
115 echo updating
2 records
in csql through gateway
116 $CSQL_INSTALL_ROOT/bin
/csql
-g -s ${REL_PATH}/csqlupd.sql
>/dev
/null
2>&1
119 rm -f /tmp
/csql
/csqltable.conf
120 touch /tmp
/csql
/csqltable.conf
121 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
122 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
126 echo cacheverify
-t t1
-f
127 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
130 rm -f /tmp
/csql
/csqltable.conf
131 touch /tmp
/csql
/csqltable.conf
132 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
133 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
137 echo deleting
2 records
in csql through gateway
138 $CSQL_INSTALL_ROOT/bin
/csql
-g -s ${REL_PATH}/csqldel.sql
>/dev
/null
2>&1
141 rm -f /tmp
/csql
/csqltable.conf
142 touch /tmp
/csql
/csqltable.conf
143 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
144 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
148 echo cacheverify
-t t1
-p
149 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
152 rm -f /tmp
/csql
/csqltable.conf
153 touch /tmp
/csql
/csqltable.conf
154 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
155 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
159 echo updating
2 records
in mysql
160 isql
$DS < ${REL_PATH}/mysqlupd.sql
>/dev
/null
2>&1
163 rm -f /tmp
/csql
/csqltable.conf
164 touch /tmp
/csql
/csqltable.conf
165 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
166 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
170 echo cacheverify
-t t1
-f
171 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
174 rm -f /tmp
/csql
/csqltable.conf
175 touch /tmp
/csql
/csqltable.conf
176 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
177 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
181 echo deleting
2 records
in mysql
182 isql
$DS < ${REL_PATH}/mysqldel.sql
>/dev
/null
2>&1
185 rm -f /tmp
/csql
/csqltable.conf
186 touch /tmp
/csql
/csqltable.conf
187 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
188 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
192 echo cacheverify
-t t1
-p
193 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
196 rm -f /tmp
/csql
/csqltable.conf
197 touch /tmp
/csql
/csqltable.conf
198 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
199 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1
203 rm -f /tmp
/csql
/csqltable.conf
204 touch /tmp
/csql
/csqltable.conf
205 isql
$DS < $REL_PATH/drop.sql
>/dev
/null
2>&1
206 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
>/dev
/null
2>&1