Skip to Content.
Sympa Menu

freetds - Re: [freetds] Ms sql backslash in named instance 2005

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Ms sql backslash in named instance 2005
  • Date: Mon, 26 Oct 2009 10:24:32 +0100

2009/10/23 <jklowden AT schemamania.org>:
> On Fri, Oct 23, 2009 at 06:56:00PM +0100, apk AT blueyonder.co.uk wrote:
>> thanks freedy and cedric for your quick response. Although that works, I'm
>> in a difficult situation where I need it to work as before. I won't go
>> into all the details but I have an existing app that not only uses freetds
>> as its intended but also parses it and uses it within an application. I
>> can't alter the app and need the functionality we have been using up to
>> now.
>> Do you know if the problem I have is a bug or a feature?
>
> Maybe a little of both.  I would say it's undesirable.
>
> What's happening: tds_read_config_info() calls parse_server_name_for_port()
> whose real purpose is to interpret instance\hostname and hostname:port
> strings.
> It's not supposed to interpret the [servername] string in freetds.conf,
> but that's what it's doing.
>

I readed again original mail and I understood that problem is that in
freetds.conf he has something like

[myserver\one]
...

[myserver\two]
...

or something like that. 0.62 understand only "server:port" syntax so
it finds "myserver\one" correctly. 0.82 change "myserver\one" to
"myserver" with instance "one" so it doesn't find "myserver" section
in file. The solution would be to search for server before parsing for
instance. This way does not break compatibility.

> If you set TDSDUMPCONFIG, you'll see near the top of the log it's looking
> for
> your 'server\name' name, and then another message, "Parsed servername, now
> back on 0" that means it parsed for a port number and came up with zero.
>
> I think the idea, once upon a time, was that
>
>        tsql -S 'instance\servername'
> or
>        tsql -S 'servername:port'
>
> would be a way to override the instance/port in freetds.conf.  But I'm not
> so
> sure that's such a great feature and, even if it is, it belongs properly to
> the tsql application, not libtds.
>

The problem is that many users used server:port syntax (which is also
used by odbc and perhaps ms dblib) so I extend it to recognize
server\instance. So removing these syntaxes from libTDS now breaks
compatibility...

See attached patch

> I would try deleting the call to parse_server_name_for_port() and see if
> that solves your problem.
>
> HTH.
>
> --jkl
>

freddy77

Attachment: instance_fix.diff
Description: Binary data




Archive powered by MHonArc 2.6.24.

Top of Page