code reorg for Transactionw!
[csql.git] / test / sql / DDL / test002.ksh
blob29ed298306e3b6f6de5b656f9e3d69f143e6cef5
1 #!/bin/ksh
2 # Testing rollback after truncating table in autocommit off mode.
3 # Create table t1 with all datatypes.
4 # Set autocommit off;
5 # insert 2 - 3 records into it.
6 # Execute truncate table t1;
7 # Rollback the transaction.
8 # There should not be any record in the table. That means after truncate rollback has no effect.
10 QUITFILE=${PWD}/sql/DDL/drop.sql
11 REL_PATH=.
12 if [ -s "$QUITFILE" ]
13 then
14 REL_PATH=`pwd`/sql/DDL
17 echo "drop table t1;" >${REL_PATH}/dropt1.sql
19 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
21 if [ "$VALGRIND" = "true" ]
22 then
23 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/aucommitoff_truncate_rollback.sql
24 else
25 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/aucommitoff_truncate_rollback.sql
26 if [ $? -ne 0 ]
27 then
28 rm -f ${REL_PATH}/dropt1.sql
29 exit 1;
33 $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1.sql
34 rm -f ${REL_PATH}/dropt1.sql
35 exit 0;