*** empty log message ***
[csql.git] / test / system / Allocator / test006.ksh
blobecc4e34690553fa48333763a186030ccd7e80b37
1 #!/bin/ksh
2 # TestCase:
3 # check pages used(normal and merged) and chunks used for user database
4 # create table t1 with two fields and index on first field
5 # create index idx1 on t1 (f1)
6 # check pages used(normal and merged) and chunks used for user database
7 # drop table t1
8 # check pages used(normal and merged) and chunks used for user database
10 #Run this test only under csql/test or on this directory.
11 #Otherwise, it may fail
12 EXECUTABLE=${PWD}/system/Allocator/create
13 REL_PATH=.
14 if [ -s "$EXECUTABLE" ]
15 then
16 REL_PATH=${PWD}/system/Allocator
19 echo "Case 1: -d option with no table"
20 if [ $VALGRIND = "true" ]
21 then
22 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2> $0.valgr
23 else
24 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
25 if [ $? -ne 0 ]
26 then
27 exit 1;
30 if [ $VALGRIND = "true" ]
31 then
32 valgrind --tool=memcheck --leak-check=full ${REL_PATH}/create 2>> $0.valgr
33 else
34 ${REL_PATH}/create
35 if [ $? -ne 0 ]
36 then
37 exit 100;
41 echo "Tables and Indexes are created"
43 echo "Case 2: -d option with 1 table"
44 if [ $VALGRIND = "true" ]
45 then
46 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2>> $0.valgr
47 else
48 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
49 if [ $? -ne 0 ]
50 then
51 exit 1;
54 if [ $VALGRIND = "true" ]
55 then
56 valgrind --tool=memcheck --leak-check=full ${REL_PATH}/drop 2>> $0.valgr
57 else
58 ${REL_PATH}/drop
59 if [ $? -ne 0 ]
60 then
61 exit 100;
64 echo "Case 3: -d option after removing table"
65 if [ $VALGRIND = "true" ]
66 then
67 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2>> $0.valgr
68 else
69 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
70 if [ $? -ne 0 ]
71 then
72 exit 3;
75 exit 0