File Removed
[csql.git] / test / system / Allocator / test003.ksh
blob6b04723ff8d0efccc4513b898d32b42ce960f631
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 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
14 #Run this test only under csql/test or on this directory.
15 #Otherwise, it may fail
16 EXECUTABLE=${PWD}/system/Allocator/create
17 REL_PATH=.
18 if [ -s "$EXECUTABLE" ]
19 then
20 REL_PATH=${PWD}/system/Allocator
23 ${REL_PATH}/create
24 if [ $? -ne 0 ]
25 then
26 exit 100;
28 echo "Tables and Indexes are created"
29 ${REL_PATH}/insert100
30 if [ $? -ne 100 ]
31 then
32 exit 100;
34 echo "Tuples inserted into table"
35 echo "Case 1: -T option for t1: with 100 tuple"
36 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
37 if [ $? -ne 0 ]
38 then
39 exit 1;
42 echo "Case 2: -I option for idx1 of t1, with 100 tuple"
43 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1
44 if [ $? -ne 0 ]
45 then
46 exit 2;
49 ${REL_PATH}/delete1
50 if [ $? -ne 1 ]
51 then
52 exit 100;
55 echo "Tuples deleted from table"
56 echo "Case 3: -T option for t1: after removing 1 tuple"
57 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
58 if [ $? -ne 0 ]
59 then
60 exit 3;
63 echo "Case 4: -I option for idx1 of t1, after removing 1 tuple"
64 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1
65 if [ $? -ne 0 ]
66 then
67 exit 4;
70 ${REL_PATH}/drop
71 if [ $? -ne 0 ]
72 then
73 exit 100;
75 echo "Tables and Indexes are dropped"
77 exit 0