2 # Table recovery with more than one Composite index
3 # a.start mysqlserver and create table in mysql t1(f1 int , f2 int,f3 int,f4 char(10),primary key(f1,f2) ), create index idx2 on t1 (f2,f4),create index idx3 on t1(f3,f1)
4 # b.edit csqltable.conf file and add entry for t1 table.
6 # verify that it recovers the table with both the index information and all the records using the csqldump tool.
7 #Run this test only under csql/test or on this directory.
8 #Otherwise, it may fail
9 CSQL_CONF
=${PWD}/cache
/Recovery
/csql.conf
10 input
=${PWD}/cache
/Recovery
/createt1.sql
12 if [ -s "$input" -a -s "$CSQL_CONF" ]
14 REL_PATH
=${PWD}/cache
/Recovery
16 echo "create table t1(f1 int , f2 int,f3 int,f4 char(10),primary key(f1,f2));">$REL_PATH/t1.sql
17 echo "create index ix2 on t1(f3,f4);">>$REL_PATH/t1.sql
20 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
21 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
22 echo DSN
=$DSN >> $CSQL_CONFIG_FILE
23 echo CACHE_TABLE
=true
>> $CSQL_CONFIG_FILE
24 isql
$DSN < $REL_PATH/t1.sql
> /dev
/null
2>&1
27 mv /tmp
/csql.conf
$CSQL_CONFIG_FILE
28 rm -f $REL_PATH/t1.sql
32 # edit /tmp/csql/csqltable.conf
33 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
34 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
35 for (( a
=1; a
<2; a
++ ))
37 echo "1:t$a NULL NULL NULL"
38 done >> /tmp
/csql
/csqltable.conf
40 $CSQL_INSTALL_ROOT/bin
/csqlserver
-c > /dev
/null
2>&1 &
44 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
45 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
46 echo "drop table t1;">>$REL_PATH/drt1.sql
48 $CSQL_INSTALL_ROOT/bin
/csqldump
51 mv /tmp
/csql.conf
$CSQL_CONFIG_FILE
52 rm -f $REL_PATH/t1.sql
53 isql
$DSN < $REL_PATH/drt1.sql
> /dev
/null
2>&1
54 rm -f $REL_PATH/drt1.sql
58 kill $pid > /dev
/null
2>&1
59 isql
$DSN < $REL_PATH/drt1.sql
> /dev
/null
2>&1
60 rm -f $REL_PATH/t1.sql
61 rm -f $REL_PATH/drt1.sql
64 mv /tmp
/csql.conf
$CSQL_CONFIG_FILE
65 rm -f /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db
66 touch /tmp
/csql
/csqltable.conf
/tmp
/csql
/csql.db