File Removed
[csql.git] / test / system / Allocator / test004.ksh
blob96b200945f4caf99c90ecf1bfc9469d878ac28eb
1 #!/bin/sh
2 # TestCase:
3 # create table with two fields and index on first field
4 # insert 100 tuple
5 # check number of tuples, totalPagesused
6 # check pagesUsed for storing hash bucket
7 # check number of index nodes, pagesUsed for storing index nodes
8 # delete all tuples
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
16 REL_PATH=.
17 if [ -s "$EXECUTABLE" ]
18 then
19 REL_PATH=${PWD}/system/Allocator
22 ${REL_PATH}/create
23 if [ $? -ne 0 ]
24 then
25 exit 100;
27 echo "Tables and Indexes are created"
28 ${REL_PATH}/insert100
29 if [ $? -ne 100 ]
30 then
31 exit 100;
33 echo "Tuples inserted into table"
34 echo "Case 1: -T option for t1: with 100 tuple"
35 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
36 if [ $? -ne 0 ]
37 then
38 exit 1;
41 echo "Case 2: -I option for idx1 of t1, with 100 tuple"
42 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1
43 if [ $? -ne 0 ]
44 then
45 exit 2;
48 ${REL_PATH}/deleteAll
50 echo "Tuples deleted from table"
51 echo "Case 3: -T option for t1: after removing all tuple"
52 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
53 if [ $? -ne 0 ]
54 then
55 exit 3;
58 echo "Case 4: -I option for idx1 of t1, after removing all tuple"
59 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1
60 if [ $? -ne 0 ]
61 then
62 exit 4;
65 ${REL_PATH}/drop
66 if [ $? -ne 0 ]
67 then
68 exit 100;
70 echo "Tables and Indexes are dropped"
72 exit 0