2 # set DURABILITY = true in csql.conf
4 # Then create a table t1 in CSQL Client.
5 # Create tree index idx1 on t1(f1);
6 # Create the same tree index idx1 on t1(f1);
7 # kill the currently running Server.
9 # csqldump should dump the database with table and index information
11 CSQL_CONF
=${PWD}/durability
/recovery
/csql.conf
13 if [ -s "$CSQL_CONF" ]
15 REL_PATH
=${PWD}/durability
/recovery
21 cp -f $REL_PATH/csql.conf
/tmp
22 echo SYS_DB_KEY
=4444 >>/tmp
/csql.conf
23 echo USER_DB_KEY
=6666 >>/tmp
/csql.conf
24 echo DURABILITY
=true
>>/tmp
/csql.conf
25 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
27 echo "Durablity = TRUE"
29 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
33 echo "CREATE TABLE laks(f1 int);" >${REL_PATH}/create.sql
34 echo "DROP TABLE laks;" >${REL_PATH}/drop.sql
36 echo "CREATE TABLE laks(f1 int);"
37 if [ "$VALGRIND" = "true" ]
39 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/create.sql
2> $0.valgr
41 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/create.sql
>/dev
/null
2>&1
46 rm -f ${REL_PATH}/create.sql
47 rm -f ${REL_PATH}/drop.sql
53 echo "CREATE INDEX idx1 on laks(f1) TREE;" >${REL_PATH}/indexcreate.sql
54 echo "CREATE INDEX idx1 ON laks(f1) TREE;"
55 if [ "$VALGRIND" = "true" ]
57 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/indexcreate.sql
2>> $0.valgr
59 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/indexcreate.sql
>/dev
/null
2>&1
64 rm -f ${REL_PATH}/create.sql
65 rm -f ${REL_PATH}/drop.isql
66 rm -f ${REL_PATH}/indexcreate.sql
71 if [ "$VALGRIND" = "true" ]
73 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/indexcreate.sql
2>> $0.valgr
75 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/indexcreate.sql
>/dev
/null
2>&1
80 rm -f ${REL_PATH}/create.sql
81 rm -f ${REL_PATH}/drop.isql
82 rm -f ${REL_PATH}/indexcreate.sql
87 if [ "$VALGRIND" = "true" ]
89 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csqldump
2>> $0.valgr
91 $CSQL_INSTALL_ROOT/bin
/csqldump
>${REL_PATH}/before.sql
98 echo DURABILITY
=true
>>/tmp
/csql.conf
99 echo "Checking Durability"
100 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
103 echo "Server could not be Started"
105 mkdir
-p /tmp
/csql
/db
107 ipcrm
-M 4444 -M 6666
108 rm -f ${REL_PATH}/create.sql
109 rm -f ${REL_PATH}/drop.sql
110 rm -f ${REL_PATH}/indexcreate.sql
114 echo "Server Started"
117 if [ "$VALGRIND" = "true" ]
119 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csqldump
2>> $0.valgr
121 $CSQL_INSTALL_ROOT/bin
/csqldump
>${REL_PATH}/after.sql
125 diff ${REL_PATH}/before.sql
${REL_PATH}/after.sql
>/dev
/null
2>&1
128 echo Durability Works Fine
131 rm -f ${REL_PATH}/create.sql
132 rm -f ${REL_PATH}/drop.sql
133 rm -f ${REL_PATH}/before.sql
${REL_PATH}/after.sql
134 rm -f ${REL_PATH}/indexcreate.sql
136 ipcrm
-M 4444 -M 6666