adding DSN to csql.conf based on the cache test mode
[csql.git] / test / cache / CacheVerify / test010.ksh
blob286db4757e648c1b173b603ec6534d463e6b3985
1 #!/bin/sh
2 # Test Case
4 # 10. Create table t1 with primary key in csql and insert 10 tuples.
5 # Create the same table in mysql and add 10 tuples with different
6 # primary key values.
7 # Add entry for table t1 in csqltable.conf file.
8 # Now run $ csqlverify -t t1 -p.
9 # The output should be displayed without any error.
11 #Run this test only under csql/test or on this directory.
12 #Otherwise, it may fail
14 input=${PWD}/cache/CacheVerify/mysqlinput.sql
15 REL_PATH=.
16 if [ -s "$input" ]
17 then
18 REL_PATH=${PWD}/cache/CacheVerify
21 rm -f /tmp/csql/csqltable.conf
22 touch /tmp/csql/csqltable.conf
24 cp $CSQL_CONFIG_FILE /tmp/csql.conf
25 echo DSN=$DSN >>$CSQL_CONFIG_FILE
26 isql $DSN < ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1
27 if [ $? -ne 0 ]
28 then
29 cp /tmp/csql.conf $CSQL_CONFIG_FILE
30 exit 1;
33 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinput.sql >/dev/null 2>&1
34 if [ $? -ne 0 ]
35 then
36 cp /tmp/csql.conf $CSQL_CONFIG_FILE
37 exit 2;
40 echo "1:t1 NULL NULL NULL" > /tmp/csql/csqltable.conf
42 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1
43 if [ $? -ne 0 ]
44 then
45 cp /tmp/csql.conf $CSQL_CONFIG_FILE
46 exit 3;
49 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p
50 if [ $? -ne 0 ]
51 then
52 cp /tmp/csql.conf $CSQL_CONFIG_FILE
53 exit 4;
56 $CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f
57 if [ $? -ne 0 ]
58 then
59 cp /tmp/csql.conf $CSQL_CONFIG_FILE
60 exit 5;
63 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1
64 isql $DSN < $REL_PATH/drop.sql >/dev/null 2>&1
66 cp /tmp/csql.conf $CSQL_CONFIG_FILE
67 exit 0;