adding test scripts
[csql.git] / test / sql / StmtCache / test008.ksh
blob34d8672d9167fa92d53d6c14539fab3ac7cca40b
1 #!/bin/ksh
2 # create index statement should remove all the cached statements which are not in use
3 # For inuse stmts, it should not delete underlying objects as it dumps core
4 # when any method on that stmt is called after that
5 # Verify this by keeping open insert prepared stmt, then create index and then insert again.
6 # Both the values inserted should be present through index lookup
7 CREATEFILE=${PWD}/sql/StmtCache/csql.conf
8 REL_PATH=.
9 if [ -s "$CREATEFILE" ]
10 then
11 REL_PATH=`pwd`/sql/StmtCache
14 echo "drop table t1;" >${REL_PATH}/dropt1.sql
16 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
17 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/t1.sql >/dev/null 2>&1
20 if [ "$VALGRIND" = "true" ]
21 then
22 valgrind --tool=memcheck --leak-check=full $REL_PATH/stmtTest8
23 else
24 $REL_PATH/stmtTest8
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;
32 echo "select * from t1 where f2=100;" >${REL_PATH}/sel.sql
33 echo "select * from t1 where f2=200;" >>${REL_PATH}/sel.sql
34 $CSQL_INSTALL_ROOT/bin/csqldump
35 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/sel.sql
36 $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1.sql >/dev/null 2>&1
37 rm -f ${REL_PATH}/dropt1.sql
39 exit 0;