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
18 export CSQL_CONFIG_FILE
=$REL_PATH/csql.conf
19 cp $CSQL_CONFIG_FILE /tmp
20 echo DSN
=$DSN >> $CSQL_CONFIG_FILE
21 isql
$DSN < $REL_PATH/createt1.sql
> /dev
/null
2>&1
25 mv /tmp
/csql.conf
$CSQL_CONFIG_FILE
29 # edit /tmp/csql/csqltable.conf
30 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
31 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
32 for (( a
=1; a
<2; a
++ ))
34 echo "1:t$a NULL NULL NULL"
35 done >> /tmp
/csql
/csqltable.conf
37 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c >/dev
/null
2>&1 &
41 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/insert.sql
>/dev
/null
2>&1
43 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
44 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
46 $CSQL_INSTALL_ROOT/bin
/csqldump
50 mv /tmp
/csql.conf
$CSQL_CONFIG_FILE
54 kill $pid > /dev
/null
2>&1
56 isql
$DSN < $REL_PATH/drop.sql
> /dev
/null
2>&1
59 mv /tmp
/csql.conf
$CSQL_CONFIG_FILE
60 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
61 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db