Skip to Content.
Sympa Menu

freetds - Re: [freetds] Support Host/Port In DBLIB

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ken Collins <ken AT metaskills.net>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Support Host/Port In DBLIB
  • Date: Fri, 15 Apr 2011 00:00:49 -0400


OK, A recap.

1) The "host:port" syntax as a data server broken in the 0.91RC, can someone
else confirm?

2) I figured out why TDSHOST and TDSPORT were not working but it exposed a
problem elsewhere and I need some clarity on why and what to do. I set
TDSDUMPCONFIG=/some/path/file.log and got this dump back below. The reason it
works on my Mac's is that I use OpenDNS and in tds_lookup_host() it is
eventually passed a name of "SYBASE" for server_name to resolve. OpenDNS
returns an IP just fine, the Windows box and most DNS will not. It appears
that IP was not used, it just let's things progress and fill in afterward.
So, should I?

A) Not allow "SYBASE" to be set for server in tds_read_interfaces()
by setting
another environment var, TDSQUERY? Perhaps dup my :host to that too?
So this
would never happen.

if (!server || !server[0]) {
server = getenv("TDSQUERY");
if (!server || !server[0])
server = "SYBASE";

B) Should I consider another patch like this
<https://gist.github.com/913533> that
focuses on just an addition like DBSETLSERVERNAME()?

And lastly, why are other people not hitting this problem? Are they just
lucky enough to have DNS servers that respond to things like "SYBASE" and
just let FreeTDS move on? Or perhaps everyone is setting TDSQUERY? Or maybe I
am in a special boat since I am defining SYDBLIB and not MSDBLIB? Who knows :)



log.c:196:Starting log file for FreeTDS 0.92.dev.20110414
on 2011-04-14 15:07:47 with debug flags 0x4fff.
config.c:185:Getting connection information for [].
config.c:189:Attempting to read conf files.
config.c:346:... $FREETDSCONF not set. Trying $FREETDS/etc.
config.c:359:... $FREETDS not set. Trying $HOME.
config.c:285:Could not open '/Users/kencollins/.freetds.conf'
((.freetds.conf)).
config.c:289:Found conf file '/opt/local/etc/freetds/freetds.conf' (default).
config.c:475:Looking for section global.
config.c:532: Found section global.
config.c:535:Got a match.
config.c:557: text size = '64512'
config.c:532: Found section mc2008.
config.c:546: Reached EOF
config.c:295:[] not found.
config.c:201:Failed in reading conf file. Trying interface files.
config.c:1027:Setting server to SYBASE from $TDSQUERY.
config.c:1030:Looking for server SYBASE....
config.c:1047:Looking for server in /Users/kencollins/.interfaces.
config.c:921:Searching interfaces file //Users/kencollins/.interfaces.
config.c:946:Couldn't open /Users/kencollins/.interfaces.
config.c:1067:Looking for server in /etc/freetds/interfaces.
config.c:921:Searching interfaces file /etc/freetds/interfaces.
config.c:946:Couldn't open /etc/freetds/interfaces.
config.c:1099:Setting 'ip_port' to 1533 from $TDSPORT.
config.c:203:Failed to find [] in configuration files; trying 'SYBASE'
instead.
config.c:715:Setting 'port' to 1533 from $TDSPORT.
config.c:743:Setting 'ip_addr' to 10.0.1.55 (mc2008.net) from $TDSHOST.
config.c:640:tds_config_login: client_charset is UTF-8.
config.c:217:Final connection parameters:
config.c:218: server_name = SYBASE
config.c:219: server_host_name = mc2008.net
config.c:220: ip_addr = 10.0.1.55
config.c:221: instance_name =
config.c:222: port = 1533
config.c:223: major_version = 7
config.c:224: minor_version = 1
config.c:225: block_size = 0
config.c:226: language = us_english
config.c:227: server_charset =
config.c:228: connect_timeout = 0
config.c:229: client_host_name = mc1.actionmoniker.com
config.c:230: client_charset = UTF-8
config.c:231: app_name = TinyTds
config.c:232: user_name = tinytds
config.c:235: library = DB-Library
config.c:236: bulk_copy = 0
config.c:237: suppress_language = 0
config.c:238: encrypt level = 0
config.c:239: query_timeout = 0
config.c:242: database =
config.c:243: dump_file = /Users/kencollins/Desktop/freetds.log
config.c:244: debug_flags = 0
config.c:245: text_size = 64512
config.c:246: broken_dates = 0
config.c:247: emul_little_endian = 0





Archive powered by MHonArc 2.6.24.

Top of Page