3 # 4. Create a table t1 with no primary key in mysql. and insert 2 tuples.
4 # Cache the table in csql.
5 # Run cacheverify -t t1.
6 # It should display number of records for csql and mysql respectively.
7 # Run cacheverify -t t1 -p.
8 # It should give an error saying no primary key is present on table t1.
9 # Run cacheverify -t t1 -f.
10 # It should give an error saying no primary key is present on table t1.
12 #Run this test only under csql/test or on this directory.
13 #Otherwise, it may fail
15 input
=${PWD}/cache
/CacheVerify
/inputtest4.sql
19 REL_PATH
=${PWD}/cache
/CacheVerify
22 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
23 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
24 echo CACHE_TABLE
=true
>>$CSQL_CONFIG_FILE
25 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
26 DS
="$DSN $DBUSER $PASSWORD"
27 rm -f /tmp
/csql
/csqlds.conf
28 touch /tmp
/csql
/csqlds.conf
29 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
35 if [ $DSN = "oracle" ]
37 isql
$DS < ${REL_PATH}/inputtest4.oracle
> /dev
/null
2>&1
43 isql
$DS < ${REL_PATH}/inputtest4.sql
> /dev
/null
2>&1
54 rm -f /tmp
/csql
/csqltable.conf
55 touch /tmp
/csql
/csqltable.conf
56 echo "1 t1 NULL NULL NULL $DSN" >/tmp
/csql
/csqltable.conf
58 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-R>/dev
/null
2>&1
61 isql
$DS < ${REL_PATH}/drop.sql
> /dev
/null
2>&1
65 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
68 isql
$DS < ${REL_PATH}/drop.sql
> /dev
/null
2>&1
72 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-p
75 isql
$DS < ${REL_PATH}/drop.sql
> /dev
/null
2>&1
79 $CSQL_INSTALL_ROOT/bin
/cacheverify
-t t1
-f
82 isql
$DS < ${REL_PATH}/drop.sql
> /dev
/null
2>&1
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