tiny_tds 2.1.6-x64-mingw-ucrt
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +407 -0
- data/.codeclimate.yml +20 -0
- data/.gitattributes +1 -0
- data/.gitignore +22 -0
- data/.rubocop.yml +31 -0
- data/CHANGELOG.md +280 -0
- data/CODE_OF_CONDUCT.md +31 -0
- data/Gemfile +2 -0
- data/ISSUE_TEMPLATE.md +38 -0
- data/MIT-LICENSE +23 -0
- data/README.md +504 -0
- data/Rakefile +62 -0
- data/VERSION +1 -0
- data/bin/defncopy-ttds +3 -0
- data/bin/tsql-ttds +3 -0
- data/docker-compose.yml +34 -0
- data/exe/.keep +0 -0
- data/ext/tiny_tds/client.c +499 -0
- data/ext/tiny_tds/client.h +53 -0
- data/ext/tiny_tds/extconf.rb +92 -0
- data/ext/tiny_tds/extconsts.rb +15 -0
- data/ext/tiny_tds/result.c +634 -0
- data/ext/tiny_tds/result.h +32 -0
- data/ext/tiny_tds/tiny_tds_ext.c +12 -0
- data/ext/tiny_tds/tiny_tds_ext.h +17 -0
- data/lib/tiny_tds/3.1/tiny_tds.so +0 -0
- data/lib/tiny_tds/3.2/tiny_tds.so +0 -0
- data/lib/tiny_tds/bin.rb +104 -0
- data/lib/tiny_tds/client.rb +136 -0
- data/lib/tiny_tds/error.rb +14 -0
- data/lib/tiny_tds/gem.rb +27 -0
- data/lib/tiny_tds/result.rb +7 -0
- data/lib/tiny_tds/version.rb +3 -0
- data/lib/tiny_tds.rb +61 -0
- data/patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff +34 -0
- data/patches/freetds/1.00.27/0002-Don-t-use-MSYS2-file-libws2_32.diff +28 -0
- data/patches/libiconv/1.14/1-avoid-gets-error.patch +17 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/bsqldb.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/datacopy.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/defncopy.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/freebcp.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/libct-4.dll +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/libsybdb-5.dll +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/osql +388 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/tdspool.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/bin/tsql.exe +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libct.dll.a +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libct.la +41 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libsybdb.dll.a +0 -0
- data/ports/x64-mingw-ucrt/freetds/1.1.24/lib/libsybdb.la +41 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/bin/iconv.exe +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/bin/libcharset-1.dll +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/bin/libiconv-2.dll +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/charset.alias +4 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libcharset.dll.a +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libcharset.la +41 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.dll.a +0 -0
- data/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.la +41 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/c_rehash +251 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/libcrypto-1_1-x64.dll +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/libssl-1_1-x64.dll +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/bin/openssl.exe +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libcrypto.a +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libcrypto.dll.a +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libssl.a +0 -0
- data/ports/x64-mingw-ucrt/openssl/1.1.1s/lib/libssl.dll.a +0 -0
- data/setup_cimgruby_dev.sh +25 -0
- data/start_dev.sh +21 -0
- data/tasks/native_gem.rake +23 -0
- data/tasks/package.rake +8 -0
- data/tasks/ports/freetds.rb +37 -0
- data/tasks/ports/libiconv.rb +26 -0
- data/tasks/ports/openssl.rb +62 -0
- data/tasks/ports/recipe.rb +64 -0
- data/tasks/ports.rake +108 -0
- data/tasks/test.rake +9 -0
- data/test/benchmark/query.rb +77 -0
- data/test/benchmark/query_odbc.rb +106 -0
- data/test/benchmark/query_tinytds.rb +126 -0
- data/test/bin/install-freetds.sh +20 -0
- data/test/bin/install-mssql.ps1 +31 -0
- data/test/bin/install-mssqltools.sh +9 -0
- data/test/bin/install-openssl.sh +18 -0
- data/test/bin/setup_tinytds_db.sh +7 -0
- data/test/bin/setup_volume_permissions.sh +10 -0
- data/test/client_test.rb +275 -0
- data/test/gem_test.rb +177 -0
- data/test/result_test.rb +814 -0
- data/test/schema/1px.gif +0 -0
- data/test/schema/sqlserver_2000.sql +140 -0
- data/test/schema/sqlserver_2005.sql +140 -0
- data/test/schema/sqlserver_2008.sql +140 -0
- data/test/schema/sqlserver_2014.sql +140 -0
- data/test/schema/sqlserver_2016.sql +140 -0
- data/test/schema/sqlserver_azure.sql +140 -0
- data/test/schema/sybase_ase.sql +138 -0
- data/test/schema_test.rb +443 -0
- data/test/sql/db-create.sql +18 -0
- data/test/sql/db-login.sql +38 -0
- data/test/test_helper.rb +280 -0
- data/test/thread_test.rb +98 -0
- data/tiny_tds.gemspec +31 -0
- metadata +267 -0
@@ -0,0 +1,388 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
# $Id: osql,v 1.12 2011-05-11 03:08:13 jklowden Exp $
|
3
|
+
#
|
4
|
+
# Check odbc.ini, odbcinst, and, optionally, freetds.conf,
|
5
|
+
# then execute isql (assume it's unixODBC's isql).
|
6
|
+
#
|
7
|
+
|
8
|
+
USAGE="Syntax: $(basename $0) -S server -U user -P password"
|
9
|
+
|
10
|
+
while getopts I:S:U:P: OPTION
|
11
|
+
do
|
12
|
+
case ${OPTION} in
|
13
|
+
I) OVER_DIR=${OPTARG} # override
|
14
|
+
;;
|
15
|
+
S) DSN=${OPTARG}
|
16
|
+
;;
|
17
|
+
U) USERNAME=${OPTARG}
|
18
|
+
;;
|
19
|
+
P) PASSWORD=${OPTARG}
|
20
|
+
;;
|
21
|
+
\?) echo $USAGE
|
22
|
+
exit 1
|
23
|
+
;;
|
24
|
+
esac
|
25
|
+
done
|
26
|
+
|
27
|
+
#cho ${DSN} ${USERNAME} ${PASSWORD}
|
28
|
+
if [ -z "${DSN}" -o -z "${USERNAME}" -o -z "${PASSWORD}" ]
|
29
|
+
then
|
30
|
+
|
31
|
+
echo $USAGE
|
32
|
+
exit 1
|
33
|
+
fi
|
34
|
+
|
35
|
+
ISQL=$(command -v isql)
|
36
|
+
if [ -z "${ISQL}" ]
|
37
|
+
then
|
38
|
+
echo "$(basename $0): error: no \"isql\" command found. Is unixODBC installed?"
|
39
|
+
exit 1
|
40
|
+
fi
|
41
|
+
|
42
|
+
# Establish ODBC prefix directory
|
43
|
+
|
44
|
+
ISQL_DIR=$(strings ${ISQL} | grep ^/ | grep -v elf | grep -v '\.so\.' | head -1 | sed 's/lib$/etc/' )
|
45
|
+
|
46
|
+
INI_DIRNAME="/tmp/$(basename $0).$$"
|
47
|
+
exec 3> ${INI_DIRNAME}
|
48
|
+
|
49
|
+
# Check the libraries, too.
|
50
|
+
if [ -z "${OVER_DIR}" ]
|
51
|
+
then
|
52
|
+
echo "checking shared odbc libraries linked to isql for default directories..."
|
53
|
+
(echo ${ISQL_DIR}; ldd "${ISQL}" | awk '/libodbc\./ {print $3}') \
|
54
|
+
| while read L
|
55
|
+
do
|
56
|
+
strings "$L" | grep '^/' | grep -v '/lib' \
|
57
|
+
| while read D
|
58
|
+
do
|
59
|
+
if [ ! -s "${INI_DIRNAME}" ]
|
60
|
+
then
|
61
|
+
printf " trying $D ... "
|
62
|
+
if [ -d "$D" -a -r "${D}/odbc.ini" ]
|
63
|
+
then
|
64
|
+
printf $D >&3
|
65
|
+
printf "OK"
|
66
|
+
else
|
67
|
+
printf "no"
|
68
|
+
fi
|
69
|
+
printf "\n"
|
70
|
+
fi
|
71
|
+
done
|
72
|
+
done
|
73
|
+
fi
|
74
|
+
|
75
|
+
ODBC_DIR=$(cat ${INI_DIRNAME}) && rm ${INI_DIRNAME}
|
76
|
+
|
77
|
+
if [ -z "${ODBC_DIR}" -a -z "${OVER_DIR}" ]
|
78
|
+
then
|
79
|
+
echo "$(basename $0): problem: no potential directory strings in \"$(command -v isql)\""
|
80
|
+
echo "$(basename $0): advice: use \"osql -I DIR\" where DIR unixODBC\'s install prefix e.g. /usr/local"
|
81
|
+
echo "isql strings are:"
|
82
|
+
strings ${ISQL} | grep ^/ | sed 's/^/+ /'
|
83
|
+
#xit 1
|
84
|
+
fi
|
85
|
+
|
86
|
+
if [ "${OVER_DIR}" ]
|
87
|
+
then
|
88
|
+
if [ -d "${ODBC_DIR}" ]
|
89
|
+
then
|
90
|
+
echo "\"${ODBC_DIR}\" is a directory, overridden by"
|
91
|
+
else
|
92
|
+
echo "\"${ODBC_DIR}\" is NOT a directory, overridden by"
|
93
|
+
fi
|
94
|
+
echo "\"${OVER_DIR}\"."
|
95
|
+
|
96
|
+
if [ -d "${OVER_DIR}" ]
|
97
|
+
then
|
98
|
+
ODBC_DIR=${OVER_DIR}
|
99
|
+
else
|
100
|
+
echo "$(basename $0): error: \"${OVER_DIR}\" is not a directory"
|
101
|
+
exit 1
|
102
|
+
fi
|
103
|
+
fi
|
104
|
+
|
105
|
+
# Look for server entry in odbc.ini
|
106
|
+
echo 'checking odbc.ini files'
|
107
|
+
for F in "${HOME}/.odbc.ini" "${ODBC_DIR}/odbc.ini"
|
108
|
+
do
|
109
|
+
if [ ! -d "$(dirname $F)" ]
|
110
|
+
then
|
111
|
+
echo "warning: $(dirname $F) is not a directory"
|
112
|
+
continue
|
113
|
+
fi
|
114
|
+
|
115
|
+
if [ -r "$F" ]
|
116
|
+
then
|
117
|
+
echo " reading $F"
|
118
|
+
else
|
119
|
+
echo " cannot read \"$F\""
|
120
|
+
continue
|
121
|
+
fi
|
122
|
+
|
123
|
+
grep -F "[${DSN}]" $F > /dev/null
|
124
|
+
|
125
|
+
if [ $? -eq 0 ]
|
126
|
+
then
|
127
|
+
echo "[${DSN}] found in $F"
|
128
|
+
ODBC_INI=$F
|
129
|
+
break
|
130
|
+
else
|
131
|
+
echo "[${DSN}] not found in $F"
|
132
|
+
fi
|
133
|
+
done
|
134
|
+
|
135
|
+
if [ -z "${ODBC_INI}" ]
|
136
|
+
then
|
137
|
+
echo "$(basename $0): error: unable to locate ${DSN} in any odbc.ini"
|
138
|
+
exit 1
|
139
|
+
fi
|
140
|
+
|
141
|
+
# Report finding of server entry
|
142
|
+
echo found this section:
|
143
|
+
SED_CMD="/^\[${DSN}\]/,/^[[:space:]]*$/ { s/^/ /; p; }"
|
144
|
+
sed -ne "${SED_CMD}" ${ODBC_INI}
|
145
|
+
|
146
|
+
#
|
147
|
+
# Examine server entry in odbc.ini
|
148
|
+
#
|
149
|
+
|
150
|
+
# Find the driver in the servername or default section
|
151
|
+
for D in "${DSN}" 'default'
|
152
|
+
do
|
153
|
+
echo "looking for driver for DSN [$D] in ${ODBC_INI}"
|
154
|
+
grep "$D" ${ODBC_INI} > /dev/null
|
155
|
+
if [ $? -eq 0 ]
|
156
|
+
then
|
157
|
+
CMD="/^\[$D\]/,/^[[:space:]]*$/ { s/^/ /; p; }"
|
158
|
+
DRIVER_LINE=$(sed -ne "${CMD}" ${ODBC_INI} \
|
159
|
+
| grep -Ei '^[[:space:]]*driver[[:space:]]*=')
|
160
|
+
if [ -z "${DRIVER_LINE}" ]
|
161
|
+
then
|
162
|
+
echo " no driver mentioned for [$D] in $(basename ${ODBC_INI})"
|
163
|
+
continue
|
164
|
+
fi
|
165
|
+
|
166
|
+
echo " found driver line: \"${DRIVER_LINE}\""
|
167
|
+
DRIVER=$(echo ${DRIVER_LINE} \
|
168
|
+
| awk -F ' *= *' '{print $2}' \
|
169
|
+
| sed 's/[[:space:]][[:space:]]*//g')
|
170
|
+
if [ "${DRIVER}" ]
|
171
|
+
then
|
172
|
+
echo " driver \"${DRIVER}\" found for [$D] in $(basename ${ODBC_INI})"
|
173
|
+
break
|
174
|
+
else
|
175
|
+
echo " driver line for [$D] incomplete in $(basename ${ODBC_INI})"
|
176
|
+
continue
|
177
|
+
fi
|
178
|
+
fi
|
179
|
+
done
|
180
|
+
|
181
|
+
if [ -z "${DRIVER}" ]
|
182
|
+
then
|
183
|
+
echo "$(basename $0): error: no driver found for [${DSN}] in $(basename ${ODBC_INI})"
|
184
|
+
exit 1
|
185
|
+
fi
|
186
|
+
|
187
|
+
# get filename of driver
|
188
|
+
echo found driver named \"${DRIVER}\"
|
189
|
+
if [ -d "${DRIVER}" -o ! -x "${DRIVER}" ]
|
190
|
+
then
|
191
|
+
# not a filename, look it up
|
192
|
+
DRIVERNAME=${DRIVER}
|
193
|
+
ODBC_INST="${ODBC_DIR}/odbcinst.ini"
|
194
|
+
echo "\"${DRIVERNAME}\" is not an executable file"
|
195
|
+
echo "looking for entry named [${DRIVERNAME}] in ${ODBC_INST}"
|
196
|
+
|
197
|
+
grep "${DRIVERNAME}" ${ODBC_INST} > /dev/null
|
198
|
+
if [ $? -ne 0 ]
|
199
|
+
then
|
200
|
+
if [ $? -eq 1 ]
|
201
|
+
then
|
202
|
+
echo "$(basename $0): error: no driver entry [${DRIVERNAME}] in ${ODBC_INST}"
|
203
|
+
fi
|
204
|
+
exit 1;
|
205
|
+
fi
|
206
|
+
|
207
|
+
CMD="/^\[${DRIVERNAME}\]/,/^[[:space:]]*$/ { s/^/ /; p; }"
|
208
|
+
DRIVER_LINE=$(sed -ne "${CMD}" ${ODBC_INST} \
|
209
|
+
| grep -Ei '^[[:space:]]*driver[[:space:]]*=')
|
210
|
+
if [ -z "${DRIVER_LINE}" ]
|
211
|
+
then
|
212
|
+
echo "$(basename $0): no driver mentioned for [${DRIVERNAME}] in $(basename ${ODBC_INST})"
|
213
|
+
exit 1
|
214
|
+
fi
|
215
|
+
|
216
|
+
echo " found driver line: \"${DRIVER_LINE}\""
|
217
|
+
DRIVER=$(echo ${DRIVER_LINE} | awk -F ' *= *' '{print $2}')
|
218
|
+
if [ -z "${DRIVER}" ]
|
219
|
+
then
|
220
|
+
echo "$(basename $0): driver line incomplete for [${DRIVERNAME}] in $(basename ${ODBC_INST})"
|
221
|
+
exit 1
|
222
|
+
fi
|
223
|
+
|
224
|
+
echo " found driver ${DRIVER} for [${DRIVERNAME}] in $(basename ${ODBC_INST})"
|
225
|
+
fi
|
226
|
+
|
227
|
+
if [ -z "${DRIVER}" ]
|
228
|
+
then
|
229
|
+
echo $(basename $0): 'error: sorry, failed sanity check: ${DRIVER} is null'
|
230
|
+
exit 1
|
231
|
+
fi
|
232
|
+
|
233
|
+
if [ -x "${DRIVER}" ]
|
234
|
+
then
|
235
|
+
echo "${DRIVER} is an executable file"
|
236
|
+
else
|
237
|
+
echo "${DRIVER} is not an executable file"
|
238
|
+
echo "$(basename $0): error: no driver found for ${DSN}"
|
239
|
+
exit 1
|
240
|
+
fi
|
241
|
+
|
242
|
+
# find the server/servername
|
243
|
+
SERVER_LINE=$(sed -ne "${SED_CMD}" ${ODBC_INI} \
|
244
|
+
| grep -Ei '^[[:space:]]*server(name)*[[:space:]]*=')
|
245
|
+
|
246
|
+
ATTRIBUTE=$(echo ${SERVER_LINE} | awk -F' *= *' '{print $1}')
|
247
|
+
|
248
|
+
if [ -z "${ATTRIBUTE}" ]
|
249
|
+
then
|
250
|
+
echo "$(basename $0): neither \"Server\" nor \"Servername\" found for [${DSN}] in $(basename ${ODBC_INI})"
|
251
|
+
exit 1
|
252
|
+
fi
|
253
|
+
|
254
|
+
echo ${SERVER_LINE} | grep -i servername >/dev/null
|
255
|
+
|
256
|
+
#
|
257
|
+
# Find the server's hostname
|
258
|
+
#
|
259
|
+
if [ $? -eq 0 ] # ODBC-Combined
|
260
|
+
then
|
261
|
+
TDS_SERVER=$(echo ${SERVER_LINE} | awk -F ' *= *' '{print $2}')
|
262
|
+
echo 'Using ODBC-Combined strategy'
|
263
|
+
echo "DSN [${DSN}] has servername \"${TDS_SERVER}\" (from ${ODBC_INI})"
|
264
|
+
if [ -z "${TDS_SERVER}" ]
|
265
|
+
then
|
266
|
+
exit 1
|
267
|
+
fi
|
268
|
+
|
269
|
+
# Look for $TDS_SERVER in freetds.conf
|
270
|
+
|
271
|
+
FREETDS_DIR=$(tsql -C | grep 'freetds.conf directory' | awk -F: '{print $2}' | sed 's/^ *//')
|
272
|
+
if [ -z "${FREETDS_DIR}" ]
|
273
|
+
then
|
274
|
+
echo "$(basename $0): error: unable to locate directory for freetds.conf using \"$(command -v tsql)\""
|
275
|
+
exit 1
|
276
|
+
fi
|
277
|
+
|
278
|
+
for F in "${HOME}/.freetds.conf" "${FREETDS_DIR}/freetds.conf"
|
279
|
+
do
|
280
|
+
if [ -r "$F" ]
|
281
|
+
then
|
282
|
+
echo $F is a readable file
|
283
|
+
else
|
284
|
+
echo cannot read \"$F\"
|
285
|
+
continue
|
286
|
+
fi
|
287
|
+
|
288
|
+
echo "looking for [${TDS_SERVER}] in $F"
|
289
|
+
grep -F "[${TDS_SERVER}]" $F > /dev/null
|
290
|
+
|
291
|
+
if [ $? -eq 0 ]
|
292
|
+
then
|
293
|
+
FREETDS_CONF=$F
|
294
|
+
break
|
295
|
+
else
|
296
|
+
echo "[${TDS_SERVER}]" not found in $F
|
297
|
+
fi
|
298
|
+
done
|
299
|
+
|
300
|
+
if [ -z "${FREETDS_CONF}" ]
|
301
|
+
then
|
302
|
+
echo "$(basename $0): error: unable to locate ${TDS_SERVER} in any freetds.conf"
|
303
|
+
exit 1
|
304
|
+
fi
|
305
|
+
|
306
|
+
# Examine server entry in freetds.conf
|
307
|
+
|
308
|
+
echo found this section:
|
309
|
+
SED_CMD="/^\[${TDS_SERVER}\]/,/^[[:space:]]*$/ { s/^/ /; p; }"
|
310
|
+
sed -ne "${SED_CMD}" ${FREETDS_CONF}
|
311
|
+
|
312
|
+
SERVER_LINE=$(sed -ne "${SED_CMD}" ${FREETDS_CONF} \
|
313
|
+
| grep -Ei '^[[:space:]]*host[[:space:]]*=')
|
314
|
+
|
315
|
+
# No character class support in mawk,
|
316
|
+
# cf. "Mawk does not support Posix character classes in expressions"
|
317
|
+
# https://bugs.launchpad.net/ubuntu/+source/mawk/+bug/69724
|
318
|
+
HOST=$(echo ${SERVER_LINE} | awk -F' *= *' '{print $2}')
|
319
|
+
|
320
|
+
if [ -z "${HOST}" ]
|
321
|
+
then
|
322
|
+
echo "$(basename $0): no \"host\" entry found for [${TDS_SERVER}] in $(basename ${FREETDS_CONF})"
|
323
|
+
exit 1
|
324
|
+
fi
|
325
|
+
|
326
|
+
else # odbc.ini contains a "server", a DNS host
|
327
|
+
HOST=$(echo ${SERVER_LINE} | awk -F ' *= *' '{print $2}')
|
328
|
+
echo "\"${ATTRIBUTE}\" found, not using freetds.conf"
|
329
|
+
echo "${ATTRIBUTE} is \"${HOST}\""
|
330
|
+
if [ -z "${HOST}" ]
|
331
|
+
then
|
332
|
+
echo "$(basename $0): no value found for \"${ATTRIBUTE}\" entry in $(basename ${ODBC_INI})"
|
333
|
+
exit 1
|
334
|
+
fi
|
335
|
+
fi
|
336
|
+
|
337
|
+
# If the "host" is an ip address, look up the name, for neatness, e.g.
|
338
|
+
## $ host 10.81.36.39
|
339
|
+
## 39.36.81.10.IN-ADDR.ARPA domain name pointer ntc5003.eg.com
|
340
|
+
if [ "${HOST}" = "$(echo ${HOST} | sed 's/[^.0-9]*//')" ]
|
341
|
+
then
|
342
|
+
ADDRESS=${HOST}
|
343
|
+
echo 'looking up hostname for ip address' ${ADDRESS}
|
344
|
+
HOST=$(host ${HOST} | awk '/domain/ {print $5}' | sed 's/\.$//')
|
345
|
+
if [ -z "${HOST}" ]
|
346
|
+
then
|
347
|
+
echo "$(basename $0): warning: no DNS hostname found for \"${ADDRESS}\""
|
348
|
+
HOST=${ADDRESS} # restore host address string
|
349
|
+
fi
|
350
|
+
fi
|
351
|
+
|
352
|
+
# Now we have a DNS hostname for the server in HOST
|
353
|
+
if [ "${HOST}" != "${ADDRESS}" ]
|
354
|
+
then
|
355
|
+
ADDRESS=$(host ${HOST} | awk '/has address/ {print $4}' | head -1)
|
356
|
+
fi
|
357
|
+
if [ -z "${ADDRESS}" ]
|
358
|
+
then
|
359
|
+
echo "$(basename $0): no IP address found for \"${HOST}\""
|
360
|
+
exit 1
|
361
|
+
fi
|
362
|
+
|
363
|
+
#cho ${HOST} has address ${ADDRESS}
|
364
|
+
|
365
|
+
# Report what we know and exec isql
|
366
|
+
|
367
|
+
printf "\n"
|
368
|
+
printf "Configuration looks OK. Connection details:\n\n"
|
369
|
+
printf "%22s:\t%-30s\n" DSN ${DSN}
|
370
|
+
printf "%22s:\t%-30s\n" odbc.ini "${ODBC_INI}"
|
371
|
+
printf "%22s:\t%-30s\n" Driver ${DRIVER}
|
372
|
+
printf "%22s:\t%-30s\n" "Server hostname" ${HOST}
|
373
|
+
printf "%22s:\t%-30s\n" Address ${ADDRESS}
|
374
|
+
printf "\n"
|
375
|
+
|
376
|
+
echo Attempting connection as ${USERNAME} ...
|
377
|
+
|
378
|
+
if [ -z "${TDSDUMP}" ]
|
379
|
+
then
|
380
|
+
TDSDUMP_AUTO="/tmp/$(basename $0).dump.$$"
|
381
|
+
export TDSDUMP=${TDSDUMP_AUTO}
|
382
|
+
fi
|
383
|
+
|
384
|
+
( set -x; isql ${DSN} ${USERNAME} ${PASSWORD} -v ) \
|
385
|
+
|| sed -ne 's/Connecting/FAILED &/p' ${TDSDUMP}
|
386
|
+
|
387
|
+
test "${TDSDUMP_AUTO}" && rm -f ${TDSDUMP_AUTO}
|
388
|
+
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# libct.la - a libtool library file
|
2
|
+
# Generated by libtool (GNU libtool) 2.4.6
|
3
|
+
#
|
4
|
+
# Please DO NOT delete this file!
|
5
|
+
# It is necessary for linking the library.
|
6
|
+
|
7
|
+
# The name that we can dlopen(3).
|
8
|
+
dlname='../bin/libct-4.dll'
|
9
|
+
|
10
|
+
# Names of this library.
|
11
|
+
library_names='libct.dll.a'
|
12
|
+
|
13
|
+
# The name of the static archive.
|
14
|
+
old_library=''
|
15
|
+
|
16
|
+
# Linker flags that cannot go in dependency_libs.
|
17
|
+
inherited_linker_flags=''
|
18
|
+
|
19
|
+
# Libraries that this one depends upon.
|
20
|
+
dependency_libs=' -R/root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib -L/root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib -L/root/project/ports/x64-mingw-ucrt/openssl/1.1.1s/lib -lws2_32 -lssl -lcrypto /root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.la'
|
21
|
+
|
22
|
+
# Names of additional weak libraries provided by this library
|
23
|
+
weak_library_names=''
|
24
|
+
|
25
|
+
# Version information for libct.
|
26
|
+
current=4
|
27
|
+
age=0
|
28
|
+
revision=0
|
29
|
+
|
30
|
+
# Is this an already installed library?
|
31
|
+
installed=yes
|
32
|
+
|
33
|
+
# Should we warn about portability when linking against -modules?
|
34
|
+
shouldnotlink=no
|
35
|
+
|
36
|
+
# Files to dlopen/dlpreopen
|
37
|
+
dlopen=''
|
38
|
+
dlpreopen=''
|
39
|
+
|
40
|
+
# Directory that this library needs to be installed in:
|
41
|
+
libdir='/root/project/ports/x64-mingw-ucrt/freetds/1.1.24/lib'
|
Binary file
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# libsybdb.la - a libtool library file
|
2
|
+
# Generated by libtool (GNU libtool) 2.4.6
|
3
|
+
#
|
4
|
+
# Please DO NOT delete this file!
|
5
|
+
# It is necessary for linking the library.
|
6
|
+
|
7
|
+
# The name that we can dlopen(3).
|
8
|
+
dlname='../bin/libsybdb-5.dll'
|
9
|
+
|
10
|
+
# Names of this library.
|
11
|
+
library_names='libsybdb.dll.a'
|
12
|
+
|
13
|
+
# The name of the static archive.
|
14
|
+
old_library=''
|
15
|
+
|
16
|
+
# Linker flags that cannot go in dependency_libs.
|
17
|
+
inherited_linker_flags=''
|
18
|
+
|
19
|
+
# Libraries that this one depends upon.
|
20
|
+
dependency_libs=' -R/root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib -L/root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib -L/root/project/ports/x64-mingw-ucrt/openssl/1.1.1s/lib -lws2_32 -lssl -lcrypto /root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib/libiconv.la'
|
21
|
+
|
22
|
+
# Names of additional weak libraries provided by this library
|
23
|
+
weak_library_names=''
|
24
|
+
|
25
|
+
# Version information for libsybdb.
|
26
|
+
current=6
|
27
|
+
age=1
|
28
|
+
revision=0
|
29
|
+
|
30
|
+
# Is this an already installed library?
|
31
|
+
installed=yes
|
32
|
+
|
33
|
+
# Should we warn about portability when linking against -modules?
|
34
|
+
shouldnotlink=no
|
35
|
+
|
36
|
+
# Files to dlopen/dlpreopen
|
37
|
+
dlopen=''
|
38
|
+
dlpreopen=''
|
39
|
+
|
40
|
+
# Directory that this library needs to be installed in:
|
41
|
+
libdir='/root/project/ports/x64-mingw-ucrt/freetds/1.1.24/lib'
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# libcharset.la - a libtool library file
|
2
|
+
# Generated by libtool (GNU libtool) 2.4.6
|
3
|
+
#
|
4
|
+
# Please DO NOT delete this file!
|
5
|
+
# It is necessary for linking the library.
|
6
|
+
|
7
|
+
# The name that we can dlopen(3).
|
8
|
+
dlname='../bin/libcharset-1.dll'
|
9
|
+
|
10
|
+
# Names of this library.
|
11
|
+
library_names='libcharset.dll.a'
|
12
|
+
|
13
|
+
# The name of the static archive.
|
14
|
+
old_library=''
|
15
|
+
|
16
|
+
# Linker flags that cannot go in dependency_libs.
|
17
|
+
inherited_linker_flags=''
|
18
|
+
|
19
|
+
# Libraries that this one depends upon.
|
20
|
+
dependency_libs=' -L/root/project/ports/x64-mingw-ucrt/openssl/1.1.1s/lib'
|
21
|
+
|
22
|
+
# Names of additional weak libraries provided by this library
|
23
|
+
weak_library_names=''
|
24
|
+
|
25
|
+
# Version information for libcharset.
|
26
|
+
current=1
|
27
|
+
age=0
|
28
|
+
revision=0
|
29
|
+
|
30
|
+
# Is this an already installed library?
|
31
|
+
installed=yes
|
32
|
+
|
33
|
+
# Should we warn about portability when linking against -modules?
|
34
|
+
shouldnotlink=no
|
35
|
+
|
36
|
+
# Files to dlopen/dlpreopen
|
37
|
+
dlopen=''
|
38
|
+
dlpreopen=''
|
39
|
+
|
40
|
+
# Directory that this library needs to be installed in:
|
41
|
+
libdir='/root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib'
|
Binary file
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# libiconv.la - a libtool library file
|
2
|
+
# Generated by libtool (GNU libtool) 2.4.6
|
3
|
+
#
|
4
|
+
# Please DO NOT delete this file!
|
5
|
+
# It is necessary for linking the library.
|
6
|
+
|
7
|
+
# The name that we can dlopen(3).
|
8
|
+
dlname='../bin/libiconv-2.dll'
|
9
|
+
|
10
|
+
# Names of this library.
|
11
|
+
library_names='libiconv.dll.a'
|
12
|
+
|
13
|
+
# The name of the static archive.
|
14
|
+
old_library=''
|
15
|
+
|
16
|
+
# Linker flags that cannot go in dependency_libs.
|
17
|
+
inherited_linker_flags=''
|
18
|
+
|
19
|
+
# Libraries that this one depends upon.
|
20
|
+
dependency_libs=' -L/root/project/ports/x64-mingw-ucrt/openssl/1.1.1s/lib'
|
21
|
+
|
22
|
+
# Names of additional weak libraries provided by this library
|
23
|
+
weak_library_names=''
|
24
|
+
|
25
|
+
# Version information for libiconv.
|
26
|
+
current=8
|
27
|
+
age=6
|
28
|
+
revision=0
|
29
|
+
|
30
|
+
# Is this an already installed library?
|
31
|
+
installed=yes
|
32
|
+
|
33
|
+
# Should we warn about portability when linking against -modules?
|
34
|
+
shouldnotlink=no
|
35
|
+
|
36
|
+
# Files to dlopen/dlpreopen
|
37
|
+
dlopen=''
|
38
|
+
dlpreopen=''
|
39
|
+
|
40
|
+
# Directory that this library needs to be installed in:
|
41
|
+
libdir='/root/project/ports/x64-mingw-ucrt/libiconv/1.15/lib'
|