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
14 #Run this test only under csql/test or on this directory.
15 #Otherwise, it may fail
16 EXECUTABLE
=${PWD}/system
/Allocator
/create
18 if [ -s "$EXECUTABLE" ]
20 REL_PATH
=${PWD}/system
/Allocator
23 if [ $VALGRIND = "true" ]
25 valgrind
--tool=memcheck
--leak-check=full
${REL_PATH}/create
2>> $0.valgr
34 echo "Tables and Indexes are created"
35 if [ $VALGRIND = "true" ]
37 valgrind
--tool=memcheck
--leak-check=full
${REL_PATH}/insert100
2>> $0.valgr
46 echo "Tuples inserted into table"
47 echo "Case 1: -T option for t1: with 100 tuple"
48 if [ $VALGRIND = "true" ]
50 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
2>> $0.valgr
52 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
59 echo "Case 2: -I option for idx1 of t1, with 100 tuple"
60 if [ $VALGRIND = "true" ]
62 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
2>> $0.valgr
64 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
71 if [ $VALGRIND = "true" ]
73 valgrind
--tool=memcheck
--leak-check=full
${REL_PATH}/delete1
2>> $0.valgr
82 echo "Tuples deleted from table"
83 echo "Case 3: -T option for t1: after removing 1 tuple"
84 if [ $VALGRIND = "true" ]
86 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
2>> $0.valgr
88 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-T t1
95 echo "Case 4: -I option for idx1 of t1, after removing 1 tuple"
96 if [ $VALGRIND = "true" ]
98 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
2>> $0.valgr
100 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-I t1idx1
112 echo "Tables and Indexes are dropped"