adding test scripts
[csql.git] / test / tools / csql / test046.ksh
blob650e849192224743fa5ea2f0f376faa6d3465f0a
1 #!/bin/ksh
2 # TEST CASE
3 # 1. create table t1 (f1 int not null, f2 int);
4 # 2. create index idx on t1 (f1) tree unique
5 # 3. insert duplicate records and it should fail
7 QUITFILE=${PWD}/tools/csql/quit.sql
8 REL_PATH=.
9 if [ -s "$QUITFILE" ]
10 then
11 REL_PATH=`pwd`/tools/csql
14 #table creation and insertino of 50 records
15 if [ "$VALGRIND" = "true" ]
16 then
17 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/tree3.sql 2> $0.valgr
18 else
19 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/tree3.sql 2>/dev/null
20 if [ $? -ne 0 ]
21 then
22 exit 1;
26 if [ "$VALGRIND" = "true" ]
27 then
28 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/selectstar.sql 2>> $0.valgr
29 else
30 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/selectstar.sql
31 if [ $? -ne 0 ]
32 then
33 exit 2;
36 echo "50 rows selected";
38 #selecting rows providing condition
39 if [ "$VALGRIND" = "true" ]
40 then
41 valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/selcond.sql 2>> $0.valgr
42 else
43 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/selcond.sql
44 if [ $? -ne 0 ]
45 then
46 exit 3;
50 $CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drop.sql
51 if [ $? -ne 0 ]
52 then
53 exit 4;
55 exit 0;