lock manager and chunk allocation mutex modificationsw
[csql.git] / test / cache / Recovery / test002.ksh
blob6a391a89579e1c3c366b0b8d649541b7b264d342
1 #!/bin/ksh
2 #This test requires kernel.shmmax to be 1GB, otherwise it may fail
5 # Start TDB and create 100 tables in TDB t1(f1 int primary key, f2 int), i
6 # t2(f1 int primary key, f2 int), ... t100 and insert 10 records each.
7 # Add entries for all 100 tables in csqltable.conf.
8 # Recover with csqlserver -c option.
9 # Verify that it recovers all the tables with index information and all
10 # the records using the csqldump tool.
12 CSQL_CONF=${PWD}/cache/Recovery/csql.conf
13 input=${PWD}/cache/Recovery/create.sql
14 REL_PATH=.
15 if [ -s "$input" -a -s "$CSQL_CONF" ]
16 then
17 REL_PATH=${PWD}/cache/Recovery
20 rm -f /tmp/csql.conf
21 cp $REL_PATH/csql.conf /tmp
22 export CSQL_CONFIG_FILE=/tmp/csql.conf
24 echo DSN=$DSN >>$CSQL_CONFIG_FILE
25 DS="$DSN $DBUSER $PASSWORD"
26 rm -f /tmp/csql/csqlds.conf
27 touch /tmp/csql/csqlds.conf
28 $CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
29 if [ $? -ne 0 ]
30 then
31 exit 1;
34 isql $DS < $REL_PATH/create.sql >/dev/null 2>&1
35 if [ $? -ne 0 ]
36 then
37 exit 2;
40 # edit /tmp/csql/csqltable.conf
41 rm -f /tmp/csql/csqltable.conf
42 touch /tmp/csql/csqltable.conf
43 a=1
45 while [[ $a -lt 101 ]];do
46 echo "1 t$a NULL NULL NULL $DSN"
47 (( a +=1 ))
48 done >> /tmp/csql/csqltable.conf
50 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
51 pid=$!
52 sleep 60
53 rm -f /tmp/csql/csqltable.conf
54 touch /tmp/csql/csqltable.conf
56 $CSQL_INSTALL_ROOT/bin/csqldump
57 if [ $? -ne 0 ]
58 then
59 kill -9 $pid > /dev/null 2>&1
60 ipcrm -M 1199 -M 2277
61 isql $DS < $REL_PATH/dropall.sql > /dev/null 2>&1
62 exit 3;
65 isql $DS < $REL_PATH/dropall.sql > /dev/null 2>&1
66 rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf
67 touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf
68 kill -9 $pid > /dev/null 2>&1
69 ipcrm -M 1199 -M 2277
70 exit 0;