first version
[csql.git] / test / tools / catalog / test005.ksh
blob3b58cf10cc4d13737708dbc0a848dbb9b07c47ad
1 #!/bin/sh
2 # Test Case
3 # check options -D chunk with empty database
4 #create table t1 (f1,f2) check with -D chunk
5 #drop t1 check with -D chunk
7 CSQL_CONF=${PWD}/tools/catalog/csql.conf
8 input=${PWD}/tools/catalog/create.sql
9 REL_PATH=.
10 if [ -s "$input" -a -s "$CSQL_CONF" ]
11 then
12 REL_PATH=${PWD}/tools/catalog
14 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
16 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
17 pid=$!
18 sleep 5
19 echo "Case 1: With -D chunk option with empty database"
20 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -D chunk
21 if [ $? -ne 0 ]
22 then
23 exit 1;
26 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/create.sql
27 if [ $? -ne 0 ]
28 then
29 exit 2;
32 echo "Case 2: With -D chunk option after table creation:"
33 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -D chunk
34 if [ $? -ne 0 ]
35 then
36 exit 3;
39 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/dropt1.sql
41 if [ $? -ne 0 ]
42 then
43 exit 4;
45 echo "t1 table droped "
47 echo "Case 3: With -D chunk option after drop t1 :"
48 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -D chunk
49 if [ $? -ne 0 ]
50 then
51 exit 5;
54 kill -9 $pid
55 ipcrm -M 1199 -M 2277
56 exit 0;