code reorg for Transactionw!
[csql.git] / test / sql / Predicate / test006.ksh
blob56f65ee2dea02dbaf9a0761ed6e39efce00de5ce
1 #!/bin/ksh
2 # Testing LIKE, IN Operators with varchar in Update 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 # Update t1 set f1=10, f2='CSQL1' where f2 LIKE 'ABCD%';
14 # Update t1 set f1=25, f2='CSQL2.5' where f2 LIKE '_BCD%';
15 # Update t1 set f1=56, f2='CSQL6.5' 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_upd.sql
31 else
32 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_like_in_upd.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;