----------------------------------------------------------------------
[csql.git] / test / durability / redologs / test009.ksh
blobfb1fe5a98c93a301a357ab7cd62c5b4fb2a51b05
1 #!/bin/ksh
2 #prepare param stmt, set param and do not execute,
3 #check stmt and redo logs, recover, check stmt and redo logs contain nothing
5 CSQL_CONF=${PWD}/durability/redologs/csql.conf
6 REL_PATH=.
7 if [ -s "$CSQL_CONF" ]
8 then
9 REL_PATH=${PWD}/durability/redologs
12 rm -f /tmp/csql.conf
13 rm -rf /tmp/csql/db/*
14 mkdir -p /tmp/csql/db
15 cp -f $REL_PATH/csql.conf /tmp
16 echo SYS_DB_KEY=4444 >>/tmp/csql.conf
17 echo ID_SHM_KEY=6666 >>/tmp/csql.conf
18 echo DURABILITY=true >>/tmp/csql.conf
19 export CSQL_CONFIG_FILE=/tmp/csql.conf
21 echo "Server Started"
22 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
23 pid=$!
24 sleep 2
26 echo "CREATE TABLE t1(f1 int not null, f2 int not null);" >${REL_PATH}/t1.sql
27 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/t1.sql
28 if [ $? -ne 0 ]
29 then
30 kill -9 $pid
31 ipcrm -M 4444 -M 6666
32 rm -f ${REL_PATH}/t1.sql
33 exit 1;
35 $REL_PATH/stmtTest9
36 $CSQL_INSTALL_ROOT/bin/redo -al
38 kill -9 $pid
39 ipcrm -M 4444 -M 6666
40 echo "Server Killed"
41 echo ""
42 echo "Checking Durability"
43 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
44 pid=$!
45 echo "Server Started"
46 sleep 2
48 $CSQL_INSTALL_ROOT/bin/redo -al
49 $CSQL_INSTALL_ROOT/bin/csqldump
52 rm -f ${REL_PATH}/t1.sql
53 kill -9 $pid
54 ipcrm -M 4444 -M 6666
55 exit 0;