Fixing failed test cache/DDL/test001.ksh
[csql.git] / test / cache / DDL / test001.ksh
blob4d36f947263a3e90eaaa68f2deca20bf1e326525
1 #!/bin/sh
3 # 1. create table t5. It should be created only in csql and not in mysql5.
5 #Run this test only under csql/test or on this directory.
6 #Otherwise, it may fail
8 CSQL_CONF=${PWD}/cache/DDL/csql.conf
9 input=${PWD}/cache/DDL/csqlinputtest1.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/dropall.sql >/dev/null
19 rm /tmp/csql/csql.db /tmp/csql/csqltable.conf
20 touch /tmp/csql/csqltable.conf
21 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
22 pid=$!
23 sleep 5
24 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql
25 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
26 isql $DSN < $REL_PATH/selectstar.sql
27 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/dropall.sql >/dev/null 2>&1
28 kill -s SIGTERM $pid 2>/dev/null
29 ipcrm -M 1199 -M 2277 2>/dev/null
30 cp /tmp/csql.conf $CSQL_CONFIG_FILE
31 exit 0