This has following fixes.
[csql.git] / test / system / Allocator / test001.ksh
blob2bbd510d16a5fa442b05f30dde51956cafa08862
1 #!/bin/sh
2 # TestCase:
3 # create table with two fields and index on first field
4 # insert 1 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 1 tuple
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 # Note: spaceused for table = noOfDataNodes * sizeofTuple + noOfPages * sizeofPageInfo
14 #Note:Thats why we see spaceused as 16 even when no tuple exist
16 #Run this test only under csql/test or on this directory.
17 #Otherwise, it may fail
18 EXECUTABLE=${PWD}/system/Allocator/create
19 REL_PATH=.
20 if [ -s "$EXECUTABLE" ]
21 then
22 REL_PATH=${PWD}/system/Allocator
25 ${REL_PATH}/create
26 if [ $? -ne 0 ]
27 then
28 exit 100;
30 echo "Tables and Indexes are created"
31 ${REL_PATH}/insert1
32 if [ $? -ne 1 ]
33 then
34 exit 100;
36 echo "Tuples inserted into table"
37 echo "Case 1: -T option for t1: with 1 tuple"
38 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
39 if [ $? -ne 0 ]
40 then
41 exit 1;
44 echo "Case 2: -I option for idx1 of t1, with 1 tuple"
45 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1
46 if [ $? -ne 0 ]
47 then
48 exit 2;
51 ${REL_PATH}/delete1
52 if [ $? -ne 1 ]
53 then
54 exit 100;
57 echo "Tuples deleted from table"
58 echo "Case 3: -T option for t1: after removing 1 tuple"
59 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
60 if [ $? -ne 0 ]
61 then
62 exit 3;
65 echo "Case 4: -I option for idx1 of t1, after removing 1 tuple"
66 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1
67 if [ $? -ne 0 ]
68 then
69 exit 4;
72 ${REL_PATH}/drop
73 if [ $? -ne 0 ]
74 then
75 exit 100;
77 echo "Tables and Indexes are dropped"
79 exit 0