*** empty log message ***
[csql.git] / test / system / Allocator / test005.ksh
blobdb265237650b3553a183014cb850d71595335ec9
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
5 # check pages used(normal and merged) and chunks used for user database
6 # drop table t1
7 # check pages used(normal and merged) and chunks used for user database
9 #Run this test only under csql/test or on this directory.
10 #Otherwise, it may fail
11 EXECUTABLE=${PWD}/system/Allocator/create
12 REL_PATH=.
13 if [ -s "$EXECUTABLE" ]
14 then
15 REL_PATH=${PWD}/system/Allocator
18 echo "Case 1: -d option with no table"
19 if [ "$VALGRIND" = "true" ]
20 then
21 valgrind --tool=memcheck --leak-check=full 2> $0.valgr
22 else
23 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
24 if [ $? -ne 0 ]
25 then
26 exit 1;
30 if [ $VALGRIND = "true" ]
31 then
32 valgrind --tool=memcheck --leak-check=full ${REL_PATH}/createNoIndex 2>> $0.valgr
33 else
34 ${REL_PATH}/createNoIndex
35 if [ $? -ne 0 ]
36 then
37 exit 100;
40 echo "Tables and Indexes are created"
42 echo "Case 2: -d option with 1 table"
43 if [ $VALGRIND = "true" ]
44 then
45 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2>> $0.valgr
46 else
47 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
48 if [ $? -ne 0 ]
49 then
50 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;
65 echo "Case 3: -d option after removing table"
66 if [ $VALGRIND = "true" ]
67 then
68 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d 2>> $0.valgr
69 else
70 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -d
71 if [ $? -ne 0 ]
72 then
73 exit 3;
77 exit 0;