*** empty log message ***
[csql.git] / test / system / Allocator / test007.ksh
blobe2a4e5e676eba01fe598ddbaa8d24e2ca55b36a8
1 #!/bin/ksh
2 # TestCase:
3 # check pages used(normal and merged) and chunks used for user database
4 # for i = 1 to 100
5 # create table t1 with two fields and index on first field
6 # create index idx1 on t1 (f1)
7 # drop table t1
8 # end for
9 # check pages used(normal and merged) and chunks used for user database
11 #Run this test only under csql/test or on this directory.
12 #Otherwise, it may fail
13 EXECUTABLE=${PWD}/system/Allocator/create
14 REL_PATH=.
15 if [ -s "$EXECUTABLE" ]
16 then
17 REL_PATH=${PWD}/system/Allocator
20 echo "Case 1: -d option with no table"
21 if [ $VALGRIND = "true" ]
22 then
23 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2> $0.valgr
24 else
25 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
26 if [ $? -ne 0 ]
27 then
28 exit 1;
31 echo "Tables and Indexes are created"
33 echo "Case 2: -d option with 1 table"
34 count=100
35 while [ ${count} -gt 0 ]
36 do
37 count=`expr ${count} - 1`
38 if [ $VALGRIND = "true" ]
39 then
40 valgrind --tool=memcheck --leak-check=full ${REL_PATH}/create 2>> $0.valgr
41 else
42 ${REL_PATH}/create
43 if [ $? -ne 0 ]
44 then
45 echo "create table failed"
46 exit 100;
49 ${REL_PATH}/drop
50 if [ $? -ne 0 ]
51 then
52 echo "drop table failed"
53 exit 100;
55 done
56 if [ $VALGRIND = "true" ]
57 then
58 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2>> $0.valgr
59 else
60 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
61 if [ $? -ne 0 ]
62 then
63 exit 1;
66 exit 0