File Removed
[csql.git] / test / tools / catalog / test004.ksh
bloba55bcf3377a35caf54ec20e9681998bd8e6d967c
1 #!/bin/sh
2 # Test Case
3 # create table t1 (f1, f2) , index t1idx1 on t1(f1), index t1idx2 on t1(f2)
4 # create table t2 (f1, f2) , index t2idx1 on t2(f1)
5 # insert 10 tuples in both t1 and t2
6 # Check -T option with table having 1 index
7 # Check -T option with table having 2 index
8 # Check -I option on index t1idx2
9 # drop tables
11 #Run this test only under csql/test or on this directory.
12 #Otherwise, it may fail
13 EXECUTABLE=${PWD}/tools/catalog/create
14 REL_PATH=.
15 if [ -s "$EXECUTABLE" ]
16 then
17 REL_PATH=${PWD}/tools/catalog
20 ${REL_PATH}/create
21 if [ $? -ne 0 ]
22 then
23 exit 1;
25 echo "Tables and Indexes are created"
26 ${REL_PATH}/insert
27 if [ $? -eq 0 ]
28 then
29 exit 1;
31 echo "Tuples inserted into table"
32 echo "Case 1: -T option for t1: with two index, with tuples"
33 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1
34 if [ $? -ne 0 ]
35 then
36 exit 1;
39 echo "Case 2: -T option for t2: with one index, with tuples"
40 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t2
41 if [ $? -ne 0 ]
42 then
43 exit 2;
46 echo "Case 3: -I option for idx2 of t1, with tuples"
47 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx2
48 if [ $? -ne 0 ]
49 then
50 exit 3;
53 ${REL_PATH}/drop
54 if [ $? -ne 0 ]
55 then
56 exit 100;
58 echo "Tables and Indexes are dropped"
60 exit 0