2 # Testing Durability in MMAP Architecture.
3 # set DURABILITY=true and MMAP=true in csql.conf
5 # Then create a table t1 in CSQL Client.
6 # Set MAX_SYS_DB_SIZE=10MB and MAX_DB_SIZE=100MB
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
=104857600 >>/tmp
/csql.conf
47 echo DURABILITY
=true
>>/tmp
/csql.conf
48 echo MMAP
=true
>>/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 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/create_5teble.sql
>/dev
/null
2>&1
61 while [[ $i -lt 6 ]];do
62 rm -f ${REL_PATH}/ins_t
$i.sql
65 rm -f ${REL_PATH}/drop_5table.sql
72 while [[ $i -lt 6 ]];do
73 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/ins_t
$i.sql
>/dev
/null
2>&1
79 while [[ $i -lt 6 ]];do
80 rm -f ${REL_PATH}/ins_t
$i.sql
83 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drop_5table.sql
84 rm -f ${REL_PATH}/drop_5table.sql
89 $CSQL_INSTALL_ROOT/bin
/csqldump
>${REL_PATH}/before.sql
95 echo DURABILITY
=true
>>/tmp
/csql.conf
96 echo "Checking Durability"
97 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
100 echo "Server could not be Started"
102 mkdir
-p /tmp
/csql
/db
104 while [[ $i -lt 6 ]];do
105 rm -f ${REL_PATH}/ins_t
$i.sql
109 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drop_5table.sql
110 rm -f ${REL_PATH}/drop_5table.sql
116 echo "Server Started"
119 $CSQL_INSTALL_ROOT/bin
/csqldump
>${REL_PATH}/after.sql
122 diff ${REL_PATH}/before.sql
${REL_PATH}/after.sql
125 echo Durability Works Fine
129 while [[ $i -lt 6 ]];do
130 rm -f ${REL_PATH}/ins_t
$i.sql
133 $CSQL_INSTALL_ROOT/bin
/csql
-u root
-p manager
-s ${REL_PATH}/drop_5table.sql
134 rm -f ${REL_PATH}/drop_5table.sql