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
20 isql
$DSN < $REL_PATH/createt1.sql
> /dev
/null
2>&1
27 # edit /tmp/csql/csqltable.conf
28 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
29 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
30 for (( a
=1; a
<2; a
++ ))
33 done >> /tmp
/csql
/csqltable.conf
35 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c >/dev
/null
2>&1 &
39 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/insert.sql
>/dev
/null
2>&1
41 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
42 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
44 $CSQL_INSTALL_ROOT/bin
/csqldump
51 kill $pid > /dev
/null
2>&1
53 isql
$DSN < $REL_PATH/drop.sql
> /dev
/null
2>&1
55 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
56 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db