Skip to Content.
Sympa Menu

freetds - Re: PATCH - few more SQL info handlers

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: PATCH - few more SQL info handlers
  • Date: 06 Nov 2002 14:04:50 +0100


Il mer, 2002-11-06 alle 13:14, Alex Hornby ha scritto:
> Hi,
>
> Here are few more stubbed out handlers - unixODBC seems to substitute in
> sensible values for the empty strings.
>
> I also changed info to report only DML as being available in
> transactions. I think this is correct, as I'd be surprised if sybase or
> sql server could roll back a create table statement!
>

Surprised but this is true :)

> Cheers,
> Alex.
>
> Index: src/odbc/odbc.c
> ===================================================================
> RCS file: /cvsroot/freetds/freetds/src/odbc/odbc.c,v
> retrieving revision 1.82
> diff -u -r1.82 odbc.c
> --- src/odbc/odbc.c 4 Nov 2002 19:49:19 -0000 1.82
> +++ src/odbc/odbc.c 6 Nov 2002 12:04:28 -0000
> @@ -2252,12 +2252,32 @@
> *uiInfoValue = SQL_SCCO_READ_ONLY;
> break;
> case SQL_TXN_CAPABLE:
> - /* transaction for DML and DDL */
> - *siInfoValue = SQL_TC_ALL;
> + /* transaction for DML only */
> + *siInfoValue = SQL_TC_DML;
> break;

This tell if database support transaction on DML and/or DDL. SQL Server
(all version) support transaction on both, so correct value is
SQL_TC_ALL

> case SQL_DEFAULT_TXN_ISOLATION:
> *uiInfoValue = SQL_TXN_READ_COMMITTED;
> break;
> + case SQL_TXN_ISOLATION_OPTION:
> + *uiInfoValue = (SQL_TXN_READ_UNCOMMITTED |
> + SQL_TXN_READ_COMMITTED | SQL_TXN_REPEATABLE_READ |
> + SQL_TXN_SERIALIZABLE);
> + break;

These are options settable with SQLSetConnectAttr, we do not support any
of those... not difficult to add but or you return
SQL_TXN_READ_COMMITTED only or you should implement this on
SQLSetConnectAttr

> + case SQL_KEYWORDS:
> + rgbInfoValue = "";
> + break;

No keywords???

> + case SQL_NUMERIC_FUNCTIONS:
> + rgbInfoValue = "";
> + break;
> + case SQL_TIMEDATE_FUNCTIONS:
> + rgbInfoValue = "";
> + break;
> + case SQL_STRING_FUNCTIONS:
> + rgbInfoValue = "";
> + break;
> + case SQL_SYSTEM_FUNCTIONS:
> + rgbInfoValue = "";
> + break;

These are integer and you return a string? Best to implement
SQLNativeSql (see prepare_call in prepare_query.c and comment above) and
fill with correct values.

See also
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbcsql/od_odbc_g_5l9r.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlgetinfo.asp

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page