[unixODBC-dev] Re: Symbol name collision between unixODBC and driver

Stephen Compall s11 at member.fsf.org
Thu Nov 3 12:17:37 GMT 2005


On Thu, 2005-11-03 at 12:04 +0100, Marc Herbert wrote:
> > Its the main point of ODBC, Your app is liniked against the driver
> > manager, then at a later date the user can add additional drivers as
> > required.
> 
> Sure, but this does not look enough to force all those symbols to have
> the same name whatever the layer is.

Since name resolution for symbols directly referenced in binaries
happens before main is called, when you call SQLDisconnect for example,
you only get the unixODBC version.

Dynamic symbol resolution (dlsym) must refer to a dlhandle on the
dlopen'd library; the call in question is here:

                  lt_dlsym( connection -> dl_handle,
                    connection -> functions[ i ].name );

The latter arg is a string containing the name of the function, which is
the same for each driver.  Hopefully that clarifies that.

Designing a new driver protocol, you could require DRIVER_NAME " " to be
prefixed to each function name, but that is not necessary, because the
unambiguity is resolved by the dlhandle and eager lookup for static
symbols.

-- 
Stephen Compall
http://scompall.nocandysoftware.com/blog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-dev/attachments/20051103/43ad5c8f/attachment.bin>


More information about the unixODBC-dev mailing list