Fixing failed test cache/DDL/test001.ksh
[csql.git] / test / cache / DDL / test002.ksh
blobaaffc7ff7a170d2c980639f2720b1b092c98e84b
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 cp $CSQL_CONFIG_FILE /tmp
17 echo DSN=$DSN >> $CSQL_CONFIG_FILE
18 isql $DSN < $REL_PATH/mysqlinputtest1.sql > /dev/null 2>&1
20 # edit /tmp/csql/csqltable.conf
21 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
22 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
23 echo "1:t1 NULL NULL NULL" >/tmp/csql/csqltable.conf
24 $CSQL_INSTALL_ROOT/bin/csqlserver -c > /dev/null 2>&1 &
25 pid=$!
26 sleep 5
27 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql
28 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
29 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
30 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
31 kill -9 $pid
32 ipcrm -M 1199 -M 2277
33 cp /tmp/csql.conf $CSQL_CONFIG_FILE
34 exit 0;