[freetds] Ms sql backslash in named instance 2005
freddy77 at gmail.com
Mon Oct 26 05:24:32 EDT 2009
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
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'
> 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
See attached patch
> I would try deleting the call to parse_server_name_for_port() and see if
> that solves your problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4132 bytes
Desc: not available
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20091026/605994b7/attachment.obj
More information about the FreeTDS