*** empty log message ***
[csql.git] / test / sql / Datatype / test001.ksh
blob380e10fb5a3d9d8913b25e559b6fb9b0a32f3157
1 #!/bin/ksh
2 # Default value testing with varchar.
3 # Create table t1( f1 int, f2 varchar(15) default 'CSQL');
4 # Insert 5 records into t1 having null values in f1 for some of the records.
5 # insert into t1 values(2,NULL); This will put NULL in f2 field.
6 # update t1 set f2=NULL where f2='Lakshya3'; this will put null in f2 field where f2='Lakshya3'
7 # Retrieve records based on varchar field.
9 CREATEFILE=${PWD}/sql/Datatype/csql.conf
10 REL_PATH=.
11 if [ -s "$CREATEFILE" ]
12 then
13 REL_PATH=`pwd`/sql/Datatype
16 echo "drop table t1;" >${REL_PATH}/dropt1.sql
18 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
20 if [ "$VALGRIND" = "true" ]
21 then
22 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_default.sql
23 else
24 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/varchar_default.sql
25 if [ $? -ne 0 ]
26 then
27 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
28 rm -f ${REL_PATH}/dropt1.sql
29 exit 1;
33 if [ "$VALGRIND" = "true" ]
34 then
35 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l
36 else
37 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l
40 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql
41 if [ $? -ne 0 ]
42 then
43 exit 2;
46 rm -f ${REL_PATH}/dropt1.sql
47 exit 0;