File Removed
[csql.git] / test / system / trans / test002.ksh
blob36e300ecff6e406cfe3a61d5249a8a80d40c8513
1 #!/bin/sh
2 # TestCase:
3 # check used and free transacation slots in transaction table
4 # create table
5 # for i = 1 to 120
6 # insert 1 tuple in 1 transaction and abort
7 # end for
8 # check used and free transacation slots in transaction table
10 #Run this test only under csql/test or on this directory.
11 #Otherwise, it may fail
12 EXECUTABLE=${PWD}/system/trans/create
13 REL_PATH=.
14 if [ -s "$EXECUTABLE" ]
15 then
16 REL_PATH=${PWD}/system/trans
18 ${REL_PATH}/create
19 if [ $? -ne 0 ]
20 then
21 echo "create table failed"
22 exit 100;
25 echo "Case 1: -d option with no transactions"
26 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -D trans
27 if [ $? -ne 0 ]
28 then
29 exit 1;
33 count=120
34 while [ ${count} -gt 0 ]
35 do
36 count=`expr ${count} - 1`
37 ${REL_PATH}/insert1andAbort >/tmp/tstlog
38 if [ $? -ne 1 ]
39 then
40 echo "insert failed"
41 exit 100;
43 done
44 echo "Case 2: -d option after 120 aborts"
45 $CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -D trans
46 if [ $? -ne 0 ]
47 then
48 exit 1;
50 ${REL_PATH}/drop
51 if [ $? -ne 0 ]
52 then
53 echo "drop table failed"
54 exit 100;
56 exit 0