adding test scripts
[csql.git] / test / sql / Predicate / test011.ksh
blob5d84e56bcefe39e8aea570fff8d4ca441fde393a
1 #!/bin/ksh
2 # Testing 'is null'/'is not null' Operators with varchar using Delete 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 # DELETE FROM t1 where f2 IS NOT NULL;
13 # DELETE FROM t1 where f2 IS NULL;
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_del.sql
29 else
30 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_NULL_del.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;