4 #19. create t1 table with some records in TDB,
5 # cache it with -c option.
6 # Insert some records which satisfy the cache condition into t1 in TDB.
7 # Insert some records which do not satisfy cache condition into t1 in TDB.
8 # Reload t1 with -r option
9 # CSQL should contain all records which satisfies cache condition from TDB
11 #Run this test only under csql/test or on this directory.
12 #otherwise, it may fail.
14 # AUTHOR : Jitendra Lenka
15 input
=${PWD}/cache
/CacheTable
/inputtest4.sql
19 REL_PATH
=${PWD}/cache
/CacheTable
22 cp $CSQL_CONFIG_FILE /tmp
/csql.conf
23 echo CACHE_TABLE
=true
>>$CSQL_CONFIG_FILE
24 echo DSN
=$DSN >>$CSQL_CONFIG_FILE
25 DS
="$DSN $DBUSER $PASSWORD"
26 rm -f /tmp
/csql
/csqlds.conf
27 touch /tmp
/csql
/csqlds.conf
28 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a
31 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
35 isql
$DS < ${REL_PATH}/inputtest4.sql
>/dev
/null
2>&1
38 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
42 rm -f /tmp
/csql
/csqltable.conf
43 touch /tmp
/csql
/csqltable.conf
45 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-c "f1=1" >/dev
/null
2>&1
48 rm -f /tmp
/csql
/csqltable.conf
49 touch /tmp
/csql
/csqltable.conf
50 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
51 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
52 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
56 echo after cahe with
-c option
57 echo "select * from t1"
60 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/selectt1.sql
63 rm -f /tmp
/csql
/csqltable.conf
64 touch /tmp
/csql
/csqltable.conf
65 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
66 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
67 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
72 isql
$DS < ${REL_PATH}/insert.sql
>/dev
/null
2>&1
74 # again reload table with -r option.
75 $CSQL_INSTALL_ROOT/bin
/cachetable
-t t1
-r >/dev
/null
2>&1
78 rm -f /tmp
/csql
/csqltable.conf
79 touch /tmp
/csql
/csqltable.conf
80 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
81 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
82 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
86 #after reload, select from t1
87 echo "after reload , select * from t1;"
88 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/selectt1.sql
91 rm -f /tmp
/csql
/csqltable.conf
92 touch /tmp
/csql
/csqltable.conf
93 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
94 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
95 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE
99 rm -f /tmp
/csql
/csqltable.conf
100 touch /tmp
/csql
/csqltable.conf
101 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/drop.sql
> /dev
/null
2>&1
102 isql
$DS < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
103 cp /tmp
/csql.conf
$CSQL_CONFIG_FILE