*** empty log message ***
[csql.git] / test / cache / CacheTable / test022.ksh
blob7df7c92435c3ff60c1a64e6fd6e1830c1ea7fc38
1 #!/bin/sh
2 # Test Case
4 # Create table t5 with f1 int unique and f2 int,primary key (f2) in target database
5 # Cache it with cachetable tool.
6 # Check with catalog -D chunk tool weather index is created for both primary as well as unique.
8 input=${PWD}/cache/CacheTable/createt5.sql
9 REL_PATH=.
10 if [ -s "$input" ]
11 then
12 REL_PATH=${PWD}/cache/CacheTable
14 export CSQL_CONFIG_FILE=$REL_PATH/csql.conf
15 echo DSN=$DSN >> $CSQL_CONFIG_FILE
16 isql $DSN < ${REL_PATH}/createt5.sql >/dev/null 2>&1
17 echo table t5 is created with records in target db
19 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
20 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
21 $CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 &
22 pid=$!
23 sleep 5
24 echo "1:t5 NULL NULL NULL" >> /tmp/csql/csqltable.conf
25 echo "1:t6 NULL NULL NULL" >> /tmp/csql/csqltable.conf
27 $CSQL_INSTALL_ROOT/bin/cachetable -R
28 if [ $? -ne 0 ]
29 then
30 exit 1;
33 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -D chunk
34 if [ $? -ne 0 ]
35 then
36 exit 2;
39 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l
40 if [ $? -ne 0 ]
41 then
42 exit 3;
44 $CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t5 -u
45 $CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t6 -u
46 isql $DSN < ${REL_PATH}/drop5.sql >/dev/null 2>&1
47 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql > /dev/null 2>&1
48 rm -f /tmp/csql/csqltable.conf /tmp/csql/csql.db
49 touch /tmp/csql/csqltable.conf /tmp/csql/csql.db
50 kill -9 $pid
51 ipcrm -M 4000 -M 4500
52 exit 0;