3 # create table with two fields and index on first field
5 # check number of tuples, totalPagesused
6 # check pagesUsed for storing hash bucket
7 # check number of index nodes, pagesUsed for storing index nodes
9 # check number of tuples, totalPagesused
10 # check pagesUsed for storing hash bucket
11 # check number of index nodes, pagesUsed for storing index nodes
13 #Run this test only under csql/test or on this directory.
14 #Otherwise, it may fail
15 EXECUTABLE
=${PWD}/system
/Allocator
/create
17 if [ -s "$EXECUTABLE" ]
19 REL_PATH
=${PWD}/system
/Allocator
22 if [ $VALGRIND = "true" ]
24 valgrind
--tool=memcheck
--leak-check=full
${REL_PATH}/create
2> $0.valgr
32 echo "Tables and Indexes are created"
33 if [ $VALGRIND = "true" ]
35 valgrind
--tool=memcheck
--leak-check=full
${REL_PATH}/insert100
2> $0.valgr
44 echo "Tuples inserted into table"
45 echo "Case 1: -T option for t1: with 100 tuple"
46 if [ $VALGRIND = "true" ]
48 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
2> $0.valgr
50 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
56 echo "Case 2: -I option for idx1 of t1, with 100 tuple"
57 if [ $VALGRIND = "true" ]
59 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
2> $0.valgr
61 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
67 if [ $VALGRIND = "true" ]
69 valgrind
--tool=memcheck
--leak-check=full
${REL_PATH}/deleteAll
2> $0.valgr
73 echo "Tuples deleted from table"
74 echo "Case 3: -T option for t1: after removing all tuple"
75 if [ $VALGRIND = "true" ]
77 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
2> $0.valgr
79 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
85 echo "Case 4: -I option for idx1 of t1, after removing all tuple"
86 if [ $VALGRIND = "true" ]
88 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
2> $0.valgr
90 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
101 echo "Tables and Indexes are dropped"