3 # 1. Create 2 tables in each of the TDB in
4 # MySQL, Postgres,DB2 and Oracle.
6 # Default DSN is set as "myodbc3".
7 # Use "cachetable tool" to cache the tables from DSNs
8 # in a range of MySQL,Postgres,DB2 and Oracle.
10 # Use "cachetable -d <dsnName>" to cache all the tables from a specific DSN.
12 # Run this test only under cql/test or on this directory,
13 # Otherwise it will fail.
16 input
=${PWD}/cache
/MultiDsn
/CacheToolOptions
/mysqltable.sql
20 REL_PATH
=${PWD}/cache
/MultiDsn
/CacheToolOptions
24 cp -f $REL_PATH/csql.conf
/tmp
25 export CSQL_CONFIG_FILE
=/tmp
/csql.conf
27 echo DSN
=$MYSQL_DSN >>$CSQL_CONFIG_FILE
29 rm -f /tmp
/csql
/csqlds.conf
30 touch /tmp
/csql
/csqlds.conf
33 ########## csqlds.conf entries #########
35 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $MYSQL_USER -P $MYSQL_PASSWORD -D $MYSQL_DSN -N $MYSQL_TDB -a
40 echo "Entries made for $MYSQL_DSN in csqlds.conf file."
42 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $POSTGRES_USER -P $POSTGRES_PASSWORD -D $POSTGRES_DSN -N $POSTGRES_TDB -a
47 echo "Entries made for $POSTGRES_DSN in csqlds.conf file."
49 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $DB2_USER -P $DB2_PASSWORD -D $DB2_DSN -N $DB2_TDB -a
54 echo "Entries made for $DB2_DSN in csqlds.conf file."
56 $CSQL_INSTALL_ROOT/bin
/csqlds
-U $ORACLE_USER -P $ORACLE_PASSWORD -D $ORACLE_DSN -N $ORACLE_TDB -a
61 echo "Entries made for $ORACLE_DSN in csqlds.conf file."
63 #drop teh table in all DSN if exists.
64 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
65 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
66 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
67 isql
$DS4 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
70 ####### Craete Table in all DSN #######
72 isql
$DS1 < ${REL_PATH}/mysqltable.sql
>/dev
/null
2>&1
77 echo "Table 't1 and t2' is created in $MYSQL_DSN"
79 isql
$DS2 < ${REL_PATH}/psqltable.sql
>/dev
/null
2>&1
82 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
85 echo "Table 't3 and t4' is created in $POSTGRES_DSN"
87 isql
$DS3 < ${REL_PATH}/db2table.sql
>/dev
/null
2>&1
90 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
91 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
94 echo "Table 't5 and t6' is created in $DB2_DSN"
96 isql
$DS4 < ${REL_PATH}/oracletable.sql
>/dev
/null
2>&1
99 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
100 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
101 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
104 echo "Table 't7 and t8' is created in $ORACLE_DSN"
107 rm -f /tmp
/csql
/csqltable.conf
108 touch /tmp
/csql
/csqltable.conf
110 # Start teh csql server.
111 $CSQL_INSTALL_ROOT/bin
/csqlserver
>/dev
/null
2>&1 &
115 #### cache all the table from DSNs #####
117 echo "Table from MySQL"
118 $CSQL_INSTALL_ROOT/bin
/cachetable
-d $MYSQL_DSN
122 ipcrm
-M 1199 -M 2277
123 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
124 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
125 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
126 isql
$DS4 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
132 echo "Tables from Postgres"
133 $CSQL_INSTALL_ROOT/bin
/cachetable
-d $POSTGRES_DSN
137 ipcrm
-M 1199 -M 2277
138 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
139 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
140 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
141 isql
$DS4 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
147 echo "Tables from DB2"
148 $CSQL_INSTALL_ROOT/bin
/cachetable
-d $DB2_DSN
152 ipcrm
-M 1199 -M 2277
153 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
154 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
155 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
156 isql
$DS4 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
162 echo "Tables from Oracle"
163 $CSQL_INSTALL_ROOT/bin
/cachetable
-d $ORACLE_DSN
167 ipcrm
-M 1199 -M 2277
168 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
169 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
170 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
171 isql
$DS4 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
176 #### Now use "cachetable -l <dsName>" ####
178 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/showtables.sql
180 rm -f /tmp
/csql
/csqltable.conf
181 touch /tmp
/csql
/csqltable.conf
183 rm -f /tmp
/csql
/csqlds.conf
184 touch /tmp
/csql
/csqlds.conf
186 isql
$DS1 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
187 isql
$DS2 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
188 isql
$DS3 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
189 isql
$DS4 < ${REL_PATH}/drop.sql
>/dev
/null
2>&1
192 $CSQL_INSTALL_ROOT/bin
/csql
-s $REL_PATH/drop.sql
> /dev
/null
2>&1
194 ipcrm
-M 1199 -M 2277