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.
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
26 if [ -s "$CREATEFILE" ]
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" ]
37 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/varchar_logical.sql
39 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/varchar_logical.sql
42 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
43 rm -f ${REL_PATH}/dropt1.sql
48 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
54 rm -f ${REL_PATH}/dropt1.sql