Skip to Content.
Sympa Menu

freetds - RE: [freetds] proposed fix to SQLGetTypeInfo in odbc.c

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'freetds AT lists.ibiblio.org'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] proposed fix to SQLGetTypeInfo in odbc.c
  • Date: Thu, 16 Jan 2003 15:34:40 -0500

> From: ZIGLIO Frediano [mailto:Frediano.Ziglio AT vodafoneomnitel.it]
> Sent: January 16, 2003 1:11 PM
> >
> > I found an issue in SQLGetTypeInfo (odbc.c). It is calling
> > a stored procedure sp_datatype_info to retrieve information
> > about supported ODBC types. Right now it calls the procedure
> > with either zero or one argument. The second argument is
> > not specified, and takes its default value -- ODBCVer = 2.
> >
> > Well ODBC Version 2 doesn't support SQL_TIMESTAMP etc. I
> > propose a change as follows (simply adding the odbc version as "3"
> > to the call to sp_datatype_info):
>
> Not acceptable. Sybase do not have ODBC version parameters...
>
> However this should be fixed, so another solution is to check
> for MS (and version)...

Steven,

Thank you for the patch.

The tds library does not determine or keep the vendor of the server, only
the protocol level. Branching on TDS version is a fair proxy. I think it
would be sufficient to wrap the MS-specific code in

if IS_TDS7_PLUS(tds) {
/* call with two paramters */
} else {
/* call with one parameter */
}

If you need this behavior with TDS 4.2, an alternative is, "select count(*)
from master..syscolumns where id = object_id('sp_datatype_info')".

Freddy, would those be OK?

As an aside, we don't state whether our driver should be considered ODBC
version 2 or 3. Either way, it's incomplete, but could someone tell me
which number better describes the current status, and which is our goal?

--jkl


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.






Archive powered by MHonArc 2.6.24.

Top of Page