2 # Testing Durability in Share Memory Architecture.
3 # set DURABILITY=true and MMAP=false in csql.conf
5 # Then create a table t1 in CSQL Client.
6 # Set MAX_SYS_DB_SIZE=10MB and MAX_DB_SIZE=33554432
7 # Create a table say t1 having 10k record with no index.
8 # Create a table say t1 having 10k record with UNIQUE HASH Index.
9 # Create a table say t1 having 10k record with UNIQUE TREE Index.
10 # Create a table say t1 having 10k record with PRIMARY KEY on INT field.
11 # Create a table say t1 having 10k record with PRIMARY KEY on CHAR field.
12 # kill the currently running Server.
14 # csqldump should dump the database with table and index information
16 CSQL_CONF
=${PWD}/durability
/recovery
/csql.conf
18 if [ -s "$CSQL_CONF" ]
20 REL_PATH
=${PWD}/durability
/recovery
24 while [[ $i -lt 6 ]];do
26 while [[ $j -lt 2001 ]];do
27 echo "INSERT INTO t$i VALUES($j,'LAKSHYA_CSQL$j');"
29 done >>${REL_PATH}/ins_t
$i.sql
34 while [[ $i -lt 6 ]];do
35 echo "DROP TABLE t$i;"
37 done >>${REL_PATH}/drop_5table.sql
42 cp -f $REL_PATH/csql.conf
/tmp
43 echo SYS_DB_KEY
=5555 >>/tmp
/csql.conf
44 echo USER_DB_KEY
=7777 >>/tmp
/csql.conf
45 echo MAX_SYS_DB_SIZE
=10485760 >>/tmp
/csql.conf
46 echo MAX_DB_SIZE
=33554432 >>/tmp
/csql.conf
47 echo DURABILITY
=true
>>/tmp
/csql.conf
48 echo MMAP
=false
>>/tmp
/csql.conf
49 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
51 echo "Durablity = TRUE"
53 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
57 if [ "$VALGRIND" = "true" ]
59 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/create_5teble.sql
2> $0.valgr
61 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/create_5teble.sql
>/dev
/null
2>&1
65 while [[ $i -lt 6 ]];do
66 rm -f ${REL_PATH}/ins_t
$i.sql
69 rm -f ${REL_PATH}/drop_5table.sql
77 while [[ $i -lt 6 ]];do
78 if [ "$VALGRIND" = "true" ]
80 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/ins_t
$i.sql
2>> $0.valgr
82 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/ins_t
$i.sql
>/dev
/null
2>&1
89 while [[ $i -lt 6 ]];do
90 rm -f ${REL_PATH}/ins_t
$i.sql
93 if [ "$VALGRIND" = "true" ]
95 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drop_5table.sql
2>> $0.valgr
97 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drop_5table.sql
99 rm -f ${REL_PATH}/drop_5table.sql
101 ipcrm
-M 5555 -M 7777
104 if [ "$VALGRIND" = "true" ]
106 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csqldump
2>> $0.valgr
108 $CSQL_INSTALL_ROOT/bin
/csqldump
>${REL_PATH}/before.sql
113 ipcrm
-M 5555 -M 7777
116 echo DURABILITY
=true
>>/tmp
/csql.conf
117 echo "Checking Durability"
118 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
120 echo "Server Started"
123 if [ "$VALGRIND" = "true" ]
125 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csqldump
2>> $0.valgr
127 $CSQL_INSTALL_ROOT/bin
/csqldump
>${REL_PATH}/after.sql
132 diff ${REL_PATH}/before.sql
${REL_PATH}/after.sql
135 echo Durability Works Fine
139 while [[ $i -lt 6 ]];do
140 rm -f ${REL_PATH}/ins_t
$i.sql
143 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drop_5table.sql
144 rm -f ${REL_PATH}/drop_5table.sql
146 ipcrm
-M 5555 -M 7777