code reorg for Transactionw!
[csql.git] / test / sql / Predicate / test007.ksh
blob8c20b443529daecf48332c3e330cc160d81fc0bb
1 #!/bin/ksh
2 # Testing 'is null'/'is not null' Operators with varchar using Update statement. ( )
3 # CREATE TABLE t1 (f1 INT , f2 VARCHAR (12));
4 # INSERT INTO t1 VALUES(1, 'ABCD');
5 # INSERT INTO t1 VALUES(2, 'NULL');
6 # INSERT INTO t1 VALUES(3, NULL);
7 # INSERT INTO t1 VALUES(4, 'ABCEF');
8 # INSERT INTO t1 (f1) VALUES (5);
9 # INSERT INTO t1 VALUES(6, 'ABCFF');
10 # Test the below queries return proper result set or not.
11 # select * from t1;
12 # Update t1 set f1= 15, f2=NULL where f2 IS NOT NULL;
13 # Update t1 set f1= 25, f2='CSQL_LAKSHYA' where f2 IS NULL and f1 <= 3;
15 CREATEFILE=${PWD}/sql/Predicate/csql.conf
16 REL_PATH=.
17 if [ -s "$CREATEFILE" ]
18 then
19 REL_PATH=`pwd`/sql/Predicate
22 echo "drop table t1;" >${REL_PATH}/dropt1.sql
24 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
26 if [ "$VALGRIND" = "true" ]
27 then
28 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_NULL_upd.sql
29 else
30 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_NULL_upd.sql
31 if [ $? -ne 0 ]
32 then
33 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
34 rm -f ${REL_PATH}/dropt1.sql
35 exit 1;
39 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
40 if [ $? -ne 0 ]
41 then
42 exit 2;
45 rm -f ${REL_PATH}/dropt1.sql
46 exit 0;