[unixODBC-dev] ODBC on 64 bit linux - test64

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Tue Jan 22 08:27:00 GMT 2008


> 
> ZIGLIO, Frediano, VF-IT wrote:
> 
> >Sebastien just reported to me log from tests ran under win64. test64
> >return
> >
> >start test test64.exe  
> >odbctest
> >--------
> >
> >connection parameters:
> >server:   'egServer80'
> >user:     'f4gl'
> >password: '????'
> >database: 'testdb'
> >use testdb
> >create table #tmp1 (i int)
> >INSERT INTO #tmp1(i) VALUES(?)
> >INSERT INTO #tmp1(i) VALUES(?)
> >INSERT INTO #tmp1(i) VALUES(?)
> >SELECT DISTINCT i FROM #tmp1
> >SELECT DISTINCT i FROM #tmp1
> >SELECT DISTINCT i FROM #tmp1
> >ok test test64.exe 
> >
> >Well... what's test64 and what does this result mean??
> >
> >test64 tests (currently) SQL_DESC_ROWS_PROCESSED_PTR. This 
> pointer holds
> >the pointer to how many rows are returned/processed. I wrote 
> test cause
> >this pointer is bound to many attributes. The test demonstrate that
> >indipendently from how you set this pointer it's always 
> SQLULEN (that is
> >64bit on 64bit platforms). So
> >- SQLSetStmtAttr SQL_ATTR_PARAMS_PROCESSED_PTR
> >- SQLSetDescField SQL_DESC_ROWS_PROCESSED_PTR (both IPD and IRD)
> >- SQLSetStmtAttr SQL_ATTR_PARAMS_PROCESSED_PTR
> >- parameter pirow of SQLParamOptions
> >- parameter RowCountPtr of SQLExtendedFetch
> >are SQLULEN* under 64bit!
> >This is not well stated at http://support.microsoft.com/kb/298678 !!
> >For this reason SQLROWSETSIZE unixODBC type should be SQLULEN not
> >SQLUINTEGER !!
> >  
> >
> 
> We have been round this several times now. The default in 
> 2.2.12 is for 
> SQLULEN to be 2 byte on 64 bit platforms, as that was how MS 
> defined it 
> in the past, and how most unix apps were built. Now MS have 
> redefined it 
> to 64 bit, so in the 2.2.13 in CVS the default is 4 byte.
> 

I'm a bit confused. SQLULEN was SQLUINTEGER on 32bit platforms that is 4
bytes. Now is UINT64 which is 64bit which is 8 bytes. Am I wrong?



> You can change the default from two to 4 in 2,2,12 by defining 
> BUILD_REAL_64_BIT_MODE and rebuilding.
> 

Yes, but you should rebuild packaged unixODBC of your distro and all
dependencies. I hope to have it fixed without all that work.

Also I noted that in sqltypes.h you have (from CVS version)

...
#if (SIZEOF_LONG_INT == 8)
#ifdef BUILD_LEGACY_64_BIT_MODE
typedef int             SQLINTEGER;
typedef unsigned int    SQLUINTEGER;
...

It's not correct 100% but only on LP64. The test should be something
like

...
#if (SIZEOF_VOID_P == 8)
#ifdef BUILD_LEGACY_64_BIT_MODE
typedef int             SQLINTEGER;
typedef unsigned int    SQLUINTEGER;
...

and define a 64 bit integer.

> I am not looking forward to all the reports of all the broken 
> apps when 
> 2.2.13 is released :-(.
> 

IMO (note, there's no H) if customers want 64bit they have to move to
64bit or stay on 32bit !!

bye
  Frediano Ziglio



More information about the unixODBC-dev mailing list