Fixing failed test
[csql.git] / test / cache / Recovery / test003.ksh
blob8227c09b170be21c7cbbd326396e4dcde494b128
1 #!/bin/sh
3 #Run this test only under csql/test or on this directory.
4 #Otherwise, it may fail
5 CSQL_CONF=${PWD}/cache/Recovery/csql.conf
6 input=${PWD}/cache/Recovery/createt1.sql
7 REL_PATH=.
8 if [ -s "$input" -a -s "$CSQL_CONF" ]
9 then
10 REL_PATH=${PWD}/cache/Recovery
12 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
13 cp $CSQL_CONFIG_FILE /tmp
14 echo DSN=$DSN >> $CSQL_CONFIG_FILE
15 isql $DSN < $REL_PATH/createt1.sql > /dev/null 2>&1
17 if [ $? -ne 0 ]
18 then
19 mv /tmp/csql.conf $CSQL_CONFIG_FILE
20 exit 1;
23 # edit /tmp/csql/csqltable.conf
24 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
25 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
26 for (( a=1; a<2; a++ ))
28 echo "1:t$a NULL NULL NULL"
29 done >> /tmp/csql/csqltable.conf
31 $CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 &
32 pid=$!
33 sleep 5
35 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
36 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
38 $CSQL_INSTALL_ROOT/bin/csqldump
40 if [ $? -ne 0 ]
41 then
42 mv /tmp/csql.conf $CSQL_CONFIG_FILE
43 exit 5;
46 kill $pid > /dev/null 2>&1
48 isql $DSN < $REL_PATH/drop.sql > /dev/null 2>&1
49 ipcrm -M 1199
50 ipcrm -M 2277
51 mv /tmp/csql.conf $CSQL_CONFIG_FILE
52 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
53 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
54 exit 0;