Skip to Content.
Sympa Menu

freetds - RE: pre2?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: RE: pre2?
  • Date: Tue, 9 Jul 2002 13:44:53 -0400


Ok, here is what is going on. We normally return SQL_SUCCESS for anything
we don't support. This allows lots of programs to get along enough to
work, but at the expense of being hard to track down when they become
flakey. Anyway, with all the patches to ODBC recently this behaviour is
flipped flopped so, SQLSetConnectOption() now returns SQL_ERROR instead of
SQL_SUCCESS. It think I'm going to create a macro called STUB_RETURN as
discussed a few months ago be strict if we are debugging but lax if we are
trying to just get things working.

Until then, (it's post 0.60 fodder anyway) here's a patch that should make
DBD::ODBC work again (make test passes 42.86% instead of 14.29% now ;-)

I'll check it in when I'm at someplace with CVS access.

--- odbc.orig Sat Jul 6 14:34:51 2002
+++ odbc.c Tue Jul 9 14:01:27 2002
@@ -1500,19 +1500,21 @@
SQLUSMALLINT fOption,
SQLPOINTER pvParam)
{
- SQLUINTEGER *piParam = (SQLUINTEGER *) pvParam;
+ SQLUINTEGER *piParam = (SQLUINTEGER *) pvParam;

- CHECK_HDBC;
- switch (fOption)
- {
-/* case :
- break; */
- default:
- tdsdump_log(TDS_DBG_INFO1, "odbc:SQLGetConnectOption: Statement
option %d not implemented\n", fOption);
- odbc_LogError ("Statement option not implemented");
- return SQL_ERROR;
- }
- return SQL_SUCCESS;
+ CHECK_HDBC;
+
+ switch (fOption) {
+ case SQL_AUTOCOMMIT:
+ *piParam = SQL_AUTOCOMMIT_ON;
+ return SQL_SUCCESS;
+ break;
+ default:
+ tdsdump_log(TDS_DBG_INFO1, "odbc:SQLGetConnectOption:
Statement option
%d not implemented\n", fOption);
+ odbc_LogError ("Statement option not implemented");
+ return SQL_ERROR;
+ }
+ return SQL_SUCCESS;
}

SQLRETURN SQL_API SQLGetData(
@@ -1998,16 +2000,21 @@
SQLUSMALLINT fOption,
SQLUINTEGER vParam)
{
- CHECK_HDBC;
+ CHECK_HDBC;

- switch (fOption)
- {
-/* case :
- break;*/
- default:
- tdsdump_log(TDS_DBG_INFO1, "odbc:SQLSetConnectOption: Statement
option %d not implemented\n", fOption);
- odbc_LogError ("Statement option not implemented");
- return SQL_ERROR;
+ switch (fOption) {
+ case SQL_AUTOCOMMIT:
+ tdsdump_log(TDS_DBG_INFO1, "odbc:SQLSetConnectOption:
SQL_AUTOCOMMIT set to %d\n", vParam);
+ if (vParam != SQL_AUTOCOMMIT_ON) {
+ odbc_LogError ("Statement option
SQL_AUTOCOMMIT does not support
OFF");
+ return SQL_ERROR;
+ }
+
+ break;
+ default:
+ tdsdump_log(TDS_DBG_INFO1, "odbc:SQLSetConnectOption:
Statement
option %d not implemented\n", fOption);
+ odbc_LogError ("Statement option not implemented");
+ return SQL_ERROR;
}
return SQL_SUCCESS;
}



> Hi Brian, the relevant portion of /etc/odbc.ini is:
>
> [mssql]
> Description =3D Default ODBC connection to mssql
> Driver =3D /usr/local/freetds/lib/libtdsodbc.so
> Servername =3D mssql
> Database =3D testdb
>
> My versions are:
> - unixODBC-2.0.7
> - DBD-ODBC-0.30
>
> I tested `isql` (for the first time) and it does work! I can connect
> and I can issue a query and get a result back (although there are some
> issues there, too, but nevermind). Does that suggest a problem with the
> Perl DBI or DBD::ODBC? I probably don't have the very latest ones of
> those.
>
> Does anyone know if there are minimum version of unixODBC, DBD::ODBC
> required for the latest version of FreeTDS to work?
>
> Thanks,
> Eric
>
>
> > -----Original Message-----
> > From: Brian Bruns [mailto:camber AT ais.org]
> > Sent: Monday, July 08, 2002 4:06 PM
> > To: TDS Development Group
> > Subject: [freetds] RE: pre2?
> >=20
> > Eric,
> >=20
> > can you send the relevent portions of your odbc.ini file and which
> version
> > of unixODBC you are running? Does this problem show up under isql (or
> is
> > it odbctest...unixodbc, iodbc i forget)
> >=20
> > Brian
> >=20
> > On Mon, 8 Jul 2002, Eric Deutsch wrote:
> >=20
> > >
> > > Hi, I've been running a few known-to-work examples I have lying
> around
> > > against the latest in CVS and have another problem. This one is not
> a
> > > high priority and I have no suggested fix, but here's something that
> > > used to work but now does not:
> > >
> > > Using Linux x86 + Perl + DBI::ODBC (not DBD::Sybase) to MS SQL
> Server
> > > 2000 using TDS 7.0, I used to be able to do some simple queries
> like:
> > >
> > > SELECT @@SERVERNAME AS 'Servername',@@VERSION AS 'Version'
> > >
> > > And get:
> > >
> > > MSSQL01 | Microsoft SQL Server 2000 - 8.00.534 (Intel X86)
> > > Nov 19 2001 13:23:50
> > > Copyright (c) 1988-2000 Microsoft Corporation
> > > Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 2)
> > >
> > > This works fine using FreeTDS 0.53-cvs2002-04-06. But under the
> latest
> > > from CVS (I'll call it FreeTDS 0.53-cvs2002-07-08), I get instead:
> > >
> > > Cannot connect to database
> > > Error 08001 ([unixODBC][Driver Manager]Data source name not found,
> and
> > > no default driver specified (SQL-IM002)
> > > [unixODBC]Statement option not implemented (SQL-08001)(DBD:
> > > dbd_db_login/SQLSetConnectOption err=3D-1))
> > >
> > > I tried another version of FreeTDS I had hanging around,
> > > 0.53-cvs2002-06-19, and that gives the same problem. So, sometime
> > > between 2002-04-06 and 2002-06-19, I lost the ability to issue even
> the
> > > simplest query via DBD::ODBC. The error message is inscrutable to
> me.
> > > The two outputs where generated on the same machine with the same
> > > odbc.ini, after doing a `make install` in the appropriately
> versioned
> > > directory so all other variables besides the FreeTDS code should
> > > probably be unrelated. In case it's useful, all three source trees
> were
> > > built with:
> > >
> > > ./autogen.sh --with-tdsver=3D7.0 --with-unixodbc=3D/usr
> > >
> > > This is not a grave issue for me since I use DBD::Sybase mostly, but
> I'm
> > > interested in seeing DBD::ODBC work, too.
> > >
> > > If I can do any additional tests, please let me know!
> > >
> > > Thanks,
> > > Eric
> > >
> > >
> > >
> > > > From: Lowden, James K [mailto:LowdenJK AT bernstein.com]
> > > > Sent: Monday, July 08, 2002 12:28 PM
> > > >
> > > > Brian,
> > > >
> > > > I think we're about done adding patches for 0.60, and except for
> the
> > > TEXT
> > > > truncation under 7.0, I think we're feature-complete. I'm
> planning on
> > > > scribbling in the UG this week; should be ready by the weekend.
> How
> > > do
> > > > things look to you?
> > > >
> > > > --jkl
> > > >
> > > > ---
> > > > You are currently subscribed to freetds as:
> > > [edeutsch AT systemsbiology.org]
> > > > To unsubscribe, forward this message to leave-freetds-
> > > > 127899P AT franklin.oit.unc.edu
> > >
> > > ---
> > > You are currently subscribed to freetds as: [camber AT ais.org]
> > > To unsubscribe, forward this message to leave-freetds-
> > 127899P AT franklin.oit.unc.edu
> > >
> > >
> >=20
> >=20
> > ---
> > You are currently subscribed to freetds as:
> [edeutsch AT systemsbiology.org]
> > To unsubscribe, forward this message to leave-freetds-
> > 127899P AT franklin.oit.unc.edu




Archive powered by MHonArc 2.6.24.

Top of Page