adding test scripts
[csql.git] / test / sql / Predicate / test010.ksh
blobb4ec16d04cb5cfd5544b33f6118b5666305ecfd2
1 #!/bin/ksh
2 # Testing LIKE, IN Operators with varchar in Delete Statement. ( )
3 # CREATE TABLE t1 (f1 INT , f2 VARCHAR (12));
4 # INSERT INTO t1 VALUES(1, 'ABCDE');
5 # INSERT INTO t1 VALUES(2, 'ABCDF');
6 # INSERT INTO t1 VALUES(3, 'NBCDGH');
7 # INSERT INTO t1 VALUES(4, 'NABCDIJ');
8 # INSERT INTO t1 VALUES(5, 'PQRST');
9 # INSERT INTO t1 VALUES(6, 'NIHAR');
10 # INSERT INTO t1 VALUES(7, 'RAHUL');
11 # Test the below Update statements return proper result set or not.
12 # select * from t1;
13 # DELETE FROM t1 where f2 LIKE 'ABCD%';
14 # DELETE FROM t1 where f2 LIKE '_BCD%';
15 # DELETE FROM t1 where f2 in ('NIHAR','rahul','CSQL1');
17 CREATEFILE=${PWD}/sql/Predicate/csql.conf
18 REL_PATH=.
19 if [ -s "$CREATEFILE" ]
20 then
21 REL_PATH=`pwd`/sql/Predicate
24 echo "drop table t1;" >${REL_PATH}/dropt1.sql
26 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
28 if [ "$VALGRIND" = "true" ]
29 then
30 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_like_in_del.sql
31 else
32 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_like_in_del.sql
33 if [ $? -ne 0 ]
34 then
35 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
36 rm -f ${REL_PATH}/dropt1.sql
37 exit 1;
41 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
42 if [ $? -ne 0 ]
43 then
44 exit 2;
47 rm -f ${REL_PATH}/dropt1.sql
48 exit 0;