2 # Testing LIKE, IN Operators with varchar
3 # CREATE TABLE t1 (f1 INT , f2 VARCHAR (12));
4 # INSERT INTO t1 VALUES(1, 'ABCD');
5 # INSERT INTO t1 VALUES(2, 'ABCDE');
6 # INSERT INTO t1 VALUES(3, 'ABCEF');
7 # INSERT INTO t1 VALUES(4, 'ABCCF');
8 # INSERT INTO t1 VALUES(5, 'ABCFF');
9 # INSERT INTO t1 VALUES(6, 'ABCDG');
10 # INSERT INTO t1 VALUES(7, 'ABDCG');
11 # Test the below queries return proper result set or not.
13 # select * from t1 where f2 like 'ABC%';
14 # select * from t1 where f2 like 'ABCD%';
15 # select * from t1 where f2 like 'ABC%F';
16 # select * from t1 where f2 in ('ABCDE','ABCCF','ABCDG');
17 # select * from t1 where f2 in ('ABCDE','ADCBF','ABCDG');
18 # The below statement should be fail, saying "Condition value should not be NULL"
19 # select * from t1 where f2 in ('ABCDE','ADCBF',NULL);
21 CREATEFILE
=${PWD}/sql
/Predicate
/csql.conf
23 if [ -s "$CREATEFILE" ]
25 REL_PATH
=`pwd`/sql
/Predicate
28 echo "drop table t1;" >${REL_PATH}/dropt1.sql
30 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
>/dev
/null
2>&1
32 if [ "$VALGRIND" = "true" ]
34 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/varchar_like_in.sql
36 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/varchar_like_in.sql
39 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
40 rm -f ${REL_PATH}/dropt1.sql
45 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
51 rm -f ${REL_PATH}/dropt1.sql