common.h added to support AbsSqlConnection and AbsSqlStatement creations
[csql.git] / test / cache / CacheTable / test009.ksh
blob1bc082873bcae72993cbac3be57505dfc9683455
1 #!/bin/sh
2 # Test Case
4 # 9.create table t1 (f1 int, f2 int) in mysql and
5 # create table t1 (f1 int, f2 int, f3 int) in csql.
6 # load with no definition option. should fail.
8 #Run this test only under csql/test or on this directory.
9 #Otherwise, it may fail
10 dropAll() {
11 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
12 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
13 #cp $CSQL_CONFIG_FILE /tmp/csql.conf
14 #echo DSN=$DSN >>$CSQL_CONFIG_FILE
15 isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1
16 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1
17 #cp /tmp/csql.conf $CSQL_CONFIG_FILE
21 input=${PWD}/cache/CacheTable/inputtest4.sql
22 REL_PATH=.
23 if [ -s "$input" ]
24 then
25 REL_PATH=${PWD}/cache/CacheTable
28 cp $CSQL_CONFIG_FILE /tmp/csql.conf
29 echo DSN=$DSN >>$CSQL_CONFIG_FILE
30 isql $DSN < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1
32 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
33 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
35 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputtest9.sql > /dev/null 2>&1
37 $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s > /dev/null 2>&1
38 if [ $? -eq 0 ]
39 then
40 dropAll
41 cp /tmp/csql.conf $CSQL_CONFIG_FILE
42 exit 1;
44 dropAll
45 cp /tmp/csql.conf $CSQL_CONFIG_FILE
46 exit 0;