*** empty log message ***
[csql.git] / test / cache / Gateway / test003.ksh
blob3f0b8027d9262034f0597d35def9a553e525a82d
1 #!/bin/sh
3 # 3. Create table t1 in CSQL with all supported data types in it. and insert 10 records in it.
4 # Note that in this test case the table is not cached in csql and is present in csql
5 # insert 10 more records using csql tool.
6 # select records with WHERE clause containing parameters for all the fields with different data types.
7 # update all fields with WHERE clause on primary key
8 # delete records with WHERE clause on all fields
10 #Run this test only under csql/test or on this directory.
11 #Otherwise, it may fail
12 CSQL_CONF=${PWD}/cache/Gateway/csql.conf
13 input=${PWD}/cache/Gateway/mysqlinputtest1.sql
14 REL_PATH=.
15 if [ -s "$input" -a -s "$CSQL_CONF" ]
16 then
17 REL_PATH=${PWD}/cache/Gateway
19 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
20 echo DSN=$DSN >> $CSQL_CONFIG_FILE
21 # edit /tmp/csql/csqltable.conf
22 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
23 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
25 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
26 pid=$!
27 sleep 5
28 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest3.sql >/dev/null 2>&1
29 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
30 isql $DSN < $REL_PATH/selectstar.sql 2>&1
31 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest3a.sql >/dev/null 2>&1
32 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/select.sql
33 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/update.sql >/dev/null 2>&1
34 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/delete.sql >/dev/null 2>&1
35 $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql
36 isql $DSN < $REL_PATH/selectstar.sql 2>&1
37 isql $DSN < $REL_PATH/dropall.sql > /dev/null 2>&1
38 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
39 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
40 kill -9 $pid
41 ipcrm -M 1199 -M 2277
42 exit 0;