Skip to Content.
Sympa Menu

freetds - PATCH - handle ODBC TXN options and emulate SQLGetStmtAttr with SQLGetStmtOption

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Alex Hornby <alex AT anvil.co.uk>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: PATCH - handle ODBC TXN options and emulate SQLGetStmtAttr with SQLGetStmtOption
  • Date: 01 Nov 2002 15:37:54 +0000


Hi,

Here's a further patch that I needed to get libodbc++ prepared
statements and transactions going.

Could someone please check and apply to CVS?

Thanks,
Alex.

Index: odbc.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/odbc/odbc.c,v
retrieving revision 1.78
diff -u -r1.78 odbc.c
--- odbc.c 1 Nov 2002 14:58:39 -0000 1.78
+++ odbc.c 1 Nov 2002 15:33:10 -0000
@@ -1550,7 +1550,12 @@
{
CHECK_HSTMT;
odbc_LogError ("SQLGetStmtAttr: function not implemented");
- return SQL_ERROR;
+
+ if ( BufferLength == SQL_IS_UINTEGER ) {
+ return SQLGetStmtOption(hstmt, Attribute, Value);
+ } else {
+ return SQL_ERROR;
+ }
}

SQLRETURN SQL_API SQLGetCursorName(
@@ -1847,6 +1852,9 @@
case SQL_AUTOCOMMIT:
* ( (SQLUINTEGER*) pvParam ) = dbc->autocommit_state;
return SQL_SUCCESS;
+ case SQL_TXN_ISOLATION:
+ * ( (SQLUINTEGER*) pvParam ) = SQL_TXN_READ_COMMITTED;
+ return SQL_SUCCESS;
default:
tdsdump_log(TDS_DBG_INFO1, "odbc:SQLGetConnectOption: Statement
option %d not implemented\n", fOption);
odbc_LogError ("Statement option not implemented");
@@ -2236,6 +2244,12 @@
break;
case SQL_SCROLL_CONCURRENCY:
*uiInfoValue = SQL_SCCO_READ_ONLY;
+ break;
+ case SQL_TXN_CAPABLE:
+ *siInfoValue = 1;
+ break;
+ case SQL_DEFAULT_TXN_ISOLATION:
+ *uiInfoValue = SQL_TXN_READ_COMMITTED;
break;
/* TODO support for other options */
default:





  • PATCH - handle ODBC TXN options and emulate SQLGetStmtAttr with SQLGetStmtOption, Alex Hornby, 11/01/2002

Archive powered by MHonArc 2.6.24.

Top of Page