Fixing system/config/test002 failed test
[csql.git] / test / cache / DDL / test002.ksh
blob51d5623cff2b9fbcd8f31e9a7e2b8ec78b520263
1 #!/bin/sh
3 # 3.recover csql with t1 table
4 # create table t1 with csql and it should fail saying table already exists
6 #Run this test only under csql/test or on this directory.
7 #Otherwise, it may fail
8 CSQL_CONF=${PWD}/cache/DDL/csql.conf
9 input=${PWD}/cache/DDL/mysqlinputtest1.sql
10 REL_PATH=.
11 if [ -s "$input" -a -s "$CSQL_CONF" ]
12 then
13 REL_PATH=${PWD}/cache/DDL
15 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
16 echo DSN=$DSN >> $CSQL_CONFIG_FILE
17 isql $DSN < $REL_PATH/mysqlinputtest1.sql > /dev/null 2>&1
19 # edit /tmp/csql/csqltable.conf
20 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
21 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
22 echo "1:t1 NULL NULL NULL" >/tmp/csql/csqltable.conf
23 $CSQL_INSTALL_ROOT/bin/csqlserver -c > /dev/null 2>&1 &
24 pid=$!
25 sleep 5
26 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql
27 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
28 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
29 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
30 kill -9 $pid
31 ipcrm -M 1199 -M 2277
32 exit 0;