[freetds] adding named instance support to ctlib

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Oct 2 02:47:55 EDT 2006


> 
> I'm nosing around at what is involved in adding named instance  
> support to ctlib. Based on the code in odbc, it looks pretty easy.
> 
> What seems the proper interface for it is to add a new property that  
> can be set by ct_con_props. So I plan to add CS_INSTANCE_NAME in the  
> properties enumeration right after CS_PORT.
> 

I would insert CS_INSTANCE_NAME a bit further in order to avoid possible
collisions

> The problem is where to store that data. TDSLOGIN does not have a  
> spot for the instance name, but TDSCONNECTION does. 
> CS_CONNECTION has  
> a TDSLOGIN member. So it looks like one of the following needs to  
> happen:
> 
> 1. Add an instance_name value to CS_CONNECTION to store the 
> property,  
> and then copy it over to the TDSCONNECTION in ct_connect.
> 
> 2. Add instance_name to TDSLOGIN and move it up in TDSCONNECT so  
> first part of the structure that is the same will include 
> instance_name.
> 
> I'm inclined to do the first since that only modified a private  
> structure that really shouldn't be used by anyone.
> 

tds.h is private in future release so even TDSLOGIN is private. I would
add a third option. ODBC support a syntax like <server>\<instance> in
SERVER option. In config.c we support <server>:<port> so perhaps
<server>\<instance> in config.c could be useful.

freddy77



More information about the FreeTDS mailing list