code reorg for Transactionw!
[csql.git] / test / sql / Datatype / test005.ksh
bloba25cca5b95419e1013d5b6fff3f68a5ec457cff1
1 #!/bin/ksh
2 # Hash Index, Unique Hash Index
3 # create table t1 (f1 varchar(10), f2 smallint);
4 # create table t2 (f1 varchar(10), f2 smallint);
5 # create index idx1 on t1(f1)hash;
6 # create index idx2 on t2(f1)hash unique;
7 # insert records into both the tables.
8 # t2.f1 field should not allow duplicate records.
10 CREATEFILE=${PWD}/sql/Datatype/csql.conf
11 REL_PATH=.
12 if [ -s "$CREATEFILE" ]
13 then
14 REL_PATH=`pwd`/sql/Datatype
17 echo "drop table t1;" >${REL_PATH}/drop.sql
18 echo "drop table t2;" >>${REL_PATH}/drop.sql
20 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql >/dev/null 2>&1
22 if [ "$VALGRIND" = "true" ]
23 then
24 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_hash.sql
25 else
26 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_hash.sql
27 if [ $? -ne 0 ]
28 then
29 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql
30 rm -f ${REL_PATH}/drop.sql
31 exit 1;
35 if [ "$VALGRIND" = "true" ]
36 then
37 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l
38 else
39 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l
42 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql
43 if [ $? -ne 0 ]
44 then
45 exit 2;
48 rm -f ${REL_PATH}/drop.sql
49 exit 0;