changing max size to fit default system shm max size
[csql.git] / test / tools / Pagesize / test001.ksh
blobb5eb1655cca7b01ad7f7e432fedc28066960fbee
1 #!/bin/ksh
2 # Checking page size
3 # Increase PAGE_SIZE 2 times of the default
4 # Set MAX_SYS_DB_SIZE=10485760
5 # Set MAX_DB_SIZE=33554432
6 # check all DDL Operations on bigger tables taking recordsize more than 1k
7 # DDL (create table,create index,drop table, drop index)
9 CSQL_CONF=${PWD}/tools/Pagesize/csql.conf
10 REL_PATH=.
11 if [ -s "$CSQL_CONF" ]
12 then
13 REL_PATH=${PWD}/tools/Pagesize
16 rm -f /tmp/csql.conf
17 rm -rf /tmp/csql/db
18 mkdir -p /tmp/csql/db
19 cp -f $REL_PATH/csql.conf /tmp
20 echo SYS_DB_KEY=4444 >>/tmp/csql.conf
21 echo USER_DB_KEY=6666 >>/tmp/csql.conf
22 echo PAGE_SIZE=16384 >>/tmp/csql.conf
23 echo MAX_SYS_DB_SIZE=10485760 >>/tmp/csql.conf
24 echo MAX_DB_SIZE=33554432 >>/tmp/csql.conf
26 export CSQL_CONFIG_FILE=/tmp/csql.conf
27 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
28 if [ $? -ne 0 ]
29 then
30 exit 1;
32 pid=$!
33 sleep 2
35 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/create_8tab.sql
36 if [ $? -ne 0 ]
37 then
38 kill -9 $pid
39 ipcrm -M 4444 -M 6666
40 exit 2;
43 i=1
44 while [[ $i -lt 2001 ]];do
45 echo "INSERT INTO t8 VALUES($i,$i,'CSQL_Lakshya$i');"
46 (( i +=1 ))
47 done >>${REL_PATH}/insert_t8.sql
49 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/insert_t8.sql >/dev/null 2>&1
50 if [ $? -ne 0 ]
51 then
52 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drop_8tab.sql
53 rm -f ${REL_PATH}/insert_t7.sql
54 kill -9 $pid
55 ipcrm -M 4444 -M 6666
56 exit 3;
58 (( i -=1 ))
59 echo "$i record inserted"
61 echo "DELETE FROM t8 WHERE f3!='CSQL_Lakshya';" >>${REL_PATH}/delete_t8.sql
63 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/delete_t8.sql
64 if [ $? -ne 0 ]
65 then
66 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drop_8tab.sql
67 rm -f ${REL_PATH}/insert_t8.sql
68 rm -f ${REL_PATH}/delete_t8.sql
69 kill -9 $pid
70 ipcrm -M 4444 -M 6666
71 exit 4;
74 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drop_8tab.sql
75 if [ $? -ne 0 ]
76 then
77 rm -f ${REL_PATH}/insert_t8.sql
78 rm -f ${REL_PATH}/delete_t8.sql
79 kill -9 $pid
80 ipcrm -M 4444 -M 6666
81 exit 5;
84 kill -9 $pid
85 ipcrm -M 4444 -M 6666
87 rm -f ${REL_PATH}/insert_t8.sql
88 rm -f ${REL_PATH}/delete_t8.sql
89 exit 0;