3 # 4. Create table t1(f1 int, f2 int, primary key (f1)); in mysql
4 # insert into t1 values(1, 11);
5 # Cache the table in CSQL.
6 # Insert the same tuple in csql.
7 # It should fail with unique key violation.
9 #Run this test only under csql/test or on this directory.
10 #Otherwise, it may fail
11 CSQL_CONF
=${PWD}/cache
/Recovery
/csql.conf
12 input
=${PWD}/cache
/Recovery
/createt1.sql
14 if [ -s "$input" -a -s "$CSQL_CONF" ]
16 REL_PATH
=${PWD}/cache
/Recovery
20 cp $REL_PATH/csql.conf
/tmp
21 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
23 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
24 DS
="$DSN $DBUSER $PASSWORD"
25 rm -f /tmp
/csql
/csqlds.conf
26 touch /tmp
/csql
/csqlds.conf
27 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
34 if [ $DSN = "oracle" ]
36 isql
$DS < $REL_PATH/createt1.oracle
> /dev
/null
2>&1
39 rm -f /tmp
/csql
/csqlds.conf
40 touch /tmp
/csql
/csqlds.conf
44 isql
$DS < $REL_PATH/createt1.sql
> /dev
/null
2>&1
47 rm -f /tmp
/csql
/csqlds.conf
48 touch /tmp
/csql
/csqlds.conf
58 # edit /tmp/csql/csqltable.conf
59 rm -f /tmp
/csql
/csqltable.conf
60 touch /tmp
/csql
/csqltable.conf
61 echo "1 t1 NULL NULL NULL $DSN" >> /tmp
/csql
/csqltable.conf
63 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c >/dev
/null
2>&1 &
67 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/insert.sql
>/dev
/null
2>&1
69 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
70 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csqlds.conf
72 $CSQL_INSTALL_ROOT/bin
/csqldump
78 kill -9 $pid > /dev
/null
2>&1
80 isql
$DS < $REL_PATH/drop.sql
> /dev
/null
2>&1
82 rm -f /tmp
/csql
/csqltable.conf
83 touch /tmp
/csql
/csqltable.conf