code reorg for Transactionw!
[csql.git] / test / sql / Predicate / test004.ksh
blob17b49388c491fba6034089537586e00b778879f6
1 #!/bin/ksh
2 # Testing Logical Operators(AND, OR, NOT) with varchar
3 # Create table t1(f1 varchar(10), f2 char(10), f3 varchar(10), f4 int);
4 # Insert into t1 values('CSQL1', 'LAKS1','BBSR1',10);
5 # Insert into t1 values('CSQL1', 'LAKS1','BBSR2',20);
6 # Insert into t1 values('CSQL1', 'LAKS2','BBSR3',30);
7 # Insert into t1 values('CSQL1', 'LAKS2','BBSR4',40);
8 # Insert into t1 values('CSQL2', 'LAKS3','BBSR5',50);
9 # Insert into t1 values('CSQL2', 'LAKS3','BBSR6',60);
10 # Insert into t1 values('CSQL2', 'LAKS4','BBSR7',70);
11 # Insert into t1 values('CSQL2', 'LAKS4','BBSR8',80);
12 # Test the below queries return proper result set or not.
13 # select * from t1;
14 # select * from t1 where f1='CSQL2';
15 # select * from t1 where not(f1='CSQL2');
16 # select * from t1 where f1='CSQL1' and f2='LAKS1';
17 # select * from t1 where f2='LAKS1' and not(f1='CSQL2');
18 # select * from t1 where f1='CSQL1' and f2='LAKS1' and f3='BBSR1';
19 # select * from t1 where f1='CSQL1' and f2='LAKS1' and not(f3='BBSR1');
20 # select * from t1 where f1='CSQL1' and f2='LAKS1' and not(f4=20);
21 # select * from t1 where f1='CSQL1' and f2='LAKS1' or not(f4=20);
22 # select * from t1 where f1='CSQL1' or f2='LAKS1' and not(f4=20);
24 CREATEFILE=${PWD}/sql/Predicate/csql.conf
25 REL_PATH=.
26 if [ -s "$CREATEFILE" ]
27 then
28 REL_PATH=`pwd`/sql/Predicate
31 echo "drop table t1;" >${REL_PATH}/dropt1.sql
33 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
35 if [ "$VALGRIND" = "true" ]
36 then
37 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_logical.sql
38 else
39 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_logical.sql
40 if [ $? -ne 0 ]
41 then
42 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
43 rm -f ${REL_PATH}/dropt1.sql
44 exit 1;
48 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
49 if [ $? -ne 0 ]
50 then
51 exit 2;
54 rm -f ${REL_PATH}/dropt1.sql
55 exit 0;