*** empty log message ***
[csql.git] / test / cache / CacheTable / test013.ksh
blob5876c007666b5c8b686774306e731fbdaea6d152
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
11 input=${PWD}/cache/CacheTable/create.sql
12 REL_PATH=.
13 if [ -s "$input" ]
14 then
15 REL_PATH=${PWD}/cache/CacheTable
18 cp $CSQL_CONFIG_FILE /tmp/csql.conf
19 echo DSN=$DSN >>$CSQL_CONFIG_FILE
20 isql $DSN < ${REL_PATH}/create.sql >/dev/null 2>&1
21 echo table t1 and t2 are created with records in target db
23 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
24 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
26 # write to csqltable.conf file
27 echo "1:t1 NULL NULL NULL" > /tmp/csql/csqltable.conf
28 echo "2:t2 NULL t2f1<5 NULL" >> /tmp/csql/csqltable.conf
30 $CSQL_INSTALL_ROOT/bin/cachetable -R
31 if [ $? -ne 0 ]
32 then
33 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
34 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
35 isql $DSN < ${REL_PATH}/dropall.sql >/dev/null 2>&1
36 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1
37 cp /tmp/csql.conf $CSQL_CONFIG_FILE
38 exit 1;
41 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/createt3.sql 2>&1 >/dev/null
43 $CSQL_INSTALL_ROOT/bin/cachetable -t t3 -u
44 if [ $? -eq 0 ]
45 then
46 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
47 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
48 isql $DSN < ${REL_PATH}/dropall.sql >/dev/null 2>&1
49 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1
50 cp /tmp/csql.conf $CSQL_CONFIG_FILE
51 exit 2;
54 rm /tmp/csql/csqltable.conf /tmp/csql/csql.db
55 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
56 isql $DSN < ${REL_PATH}/dropall.sql >/dev/null 2>&1
57 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1
58 cp /tmp/csql.conf $CSQL_CONFIG_FILE
59 exit 0;