*** empty log message ***
[csql.git] / test / sql / Predicate / test002.ksh
blob2b53abb15564b09a25691d6f9858715cb273ffd8
1 #!/bin/ksh
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.
12 # select * from t1;
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
22 REL_PATH=.
23 if [ -s "$CREATEFILE" ]
24 then
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" ]
33 then
34 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_like_in.sql
35 else
36 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_like_in.sql
37 if [ $? -ne 0 ]
38 then
39 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
40 rm -f ${REL_PATH}/dropt1.sql
41 exit 1;
45 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
46 if [ $? -ne 0 ]
47 then
48 exit 2;
51 rm -f ${REL_PATH}/dropt1.sql
52 exit 0;