Skip to Content.
Sympa Menu

freetds - Re: [freetds] 0.64rc2 Debian prerelease packages available

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT dodds.net>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] 0.64rc2 Debian prerelease packages available
  • Date: Sat, 1 Apr 2006 12:46:47 -0800

On Sat, Apr 01, 2006 at 10:27:35AM +0200, Frediano Ziglio wrote:
> Mmmm... from MS documentation it seems that row numbers, data length
> pointer and offsets became 64-bit on 64-bit platforms so from sqltypes.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;
> /*
> * These are not supprted on 64bit ODBC according to MS
> * typedef SQLULEN SQLTRANSID;
> */
> typedef SQLULEN SQLROWCOUNT;
> typedef SQLUINTEGER SQLROWSETSIZE;
> typedef SQLLEN SQLROWOFFSET;
> #endif
> #else

> I don't agree SQLROWSETSIZE is 32 bit on clean 64 bit, should be
> SQLULEN, not SQLUINTEGER

Well, that still means the current FreeTDS isn't compatible with UnixODBC
2.2.11 when building in 64-bit mode, right? The typedefs of SQLROWOFFSET
and SQLROWSETSIZE in UnixODBC may not match the MS 64-bit spec, but it looks
like SQLExtendedFetch() is still supposed to *use* SQLROWOFFSET and
SQLROWSETSIZE, so there's a (minor) bug in FreeTDS wrt the spec. :)

> Also note that pirow argument of SQLParamOptions is used for a pointer
> to row number so even this should be 64 bit so declaration in sqlext.h
> should be

> SQLRETURN SQL_API SQLParamOptions(
> SQLHSTMT hstmt,
> SQLULEN crow,
> SQLULEN *pirow);

That explains why the pirow argument might need to be SQLULEN*, but it
doesn't explain why crow would? It's only the difference in the size of
crow that breaks the ABI, AFAICS.

> So I think that unixODBC should be fixed instead of FreeTDS (unixODBC
> 2.2.12 already contains this change). Changing only FreeTDS declaration
> fix compile problems but lead to data corruptions or possible cores so I
> think is better to fix the problem in a definitive way...

> You can get unixODBC 2.2.12 (which is not a release!!) at
> ftp://ftp.easysoft.com/pub/unixODBC/

Hrm. Well, I'm not happy with the idea of freetds 0.64's ODBC driver only
being compatible with 64-bit systems when using an unreleased version of
unixodbc; but if this ABI change has already been made in unixodbc 2.2.12, I
guess we'd be better off making this same ABI change in Debian sooner rather
than later.

Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
vorlon AT debian.org http://www.debian.org/




Archive powered by MHonArc 2.6.24.

Top of Page