*** empty log message ***
[csql.git] / test / tools / catalog / test007.ksh
blob6f046fdd6749973eed15c82f49e0b260faf27ced
1 #!/bin/sh
2 # Test Case
3 # create table t4(f1, f2) primary key on f1
4 # create table t5 (f1, f2) , primary key on (f1,f2)
5 # Check -l option on primary flag of the key
6 # drop tables
8 #Run this test only under csql/test or on this directory.
9 #Otherwise, it may fail
10 REL_PATH=.
12 CSQL_CONF=${PWD}/tools/catalog/csql.conf
13 input=${PWD}/tools/catalog/create.sql
14 REL_PATH=.
15 if [ -s "$input" -a -s "$CSQL_CONF" ]
16 then
17 REL_PATH=${PWD}/tools/catalog
19 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
21 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
22 pid=$!
23 sleep 5
24 echo "Case 1: create two table t4,t5 "
25 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/createPriFlagTest.sql
26 if [ $? -ne 0 ]
27 then
28 exit 1;
31 echo "Case 2: With -l option after for primary flag checking:"
32 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l
33 if [ $? -ne 0 ]
34 then
35 exit 2;
37 echo "case 3 : drop two table "
38 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt4t5.sql
40 if [ $? -ne 0 ]
41 then
42 exit 4;
44 echo "t4 ,t5 table droped "
45 kill -9 $pid
46 ipcrm -M 1199 -M 2277
48 exit 0