Skip to Content.
Sympa Menu

freetds - Re: [freetds] ODBC on 64 bit linux fix.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Sebastien FLAESCH <sf AT 4js.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] ODBC on 64 bit linux fix.
  • Date: Fri, 18 Jan 2008 09:19:18 +0100

Hi all,

We are about to test our product with FreeTDS on Linux 64b...

In our code we use SQLULEN and SQLLEN (comes from the Windows 64b port
experience):

SQLRETURN r;
SQLUSMALLINT pos = i + 1;
SQLSMALLINT namelen;
SQLSMALLINT sqltype;
* SQLULEN precision;
SQLSMALLINT scale;
SQLSMALLINT nullable;
* SQLULEN size;
SQLSMALLINT ctype = 0;
r = SQLDescribeCol(st->stmtHandle, pos, NULL, 0,
&namelen, &sqltype, &precision, &scale, &nullable);

So first I doubt that Christos patch is I good idea:

-SQLParamOptions(SQLHSTMT hstmt, SQLULEN crow, SQLULEN FAR * pirow)
+SQLParamOptions(SQLHSTMT hstmt, SQLUINTEGER crow, SQLUINTEGER FAR * pirow)

Changing SQLULEN to SQLUINTEGER in FreeTDS would break the standards... no?

If I understand properly, we should define BUILD_REAL_64_BIT_MODE when
compiling or application code... is this correct?

According to the UnixODBC headers (sqltype.h):

#if (SIZEOF_LONG == 8)
#ifndef BUILD_REAL_64_BIT_MODE
typedef int SQLINTEGER;
typedef unsigned int SQLUINTEGER;
#define SQLLEN SQLINTEGER
#define SQLULEN SQLUINTEGER
#define SQLSETPOSIROW SQLUSMALLINT
typedef SQLULEN SQLROWCOUNT;
typedef SQLULEN SQLROWSETSIZE;
typedef SQLULEN SQLTRANSID;
typedef SQLLEN SQLROWOFFSET;
#else
typedef int SQLINTEGER;
typedef unsigned int SQLUINTEGER;
typedef long SQLLEN;
typedef unsigned long SQLULEN;
typedef unsigned long SQLSETPOSIROW;
...

If we don't define BUILD_REAL_64_BIT_MODE, SQLLEN would be an int4, since
int is 4 bytes on a 64b linux ... right?

Thanks,
Seb




Archive powered by MHonArc 2.6.24.

Top of Page