Re: FORMAT_INTEGER is wrong on (some) 64 bit platforms? - Mailing list pgsql-odbc

From Inoue, Hiroshi
Subject Re: FORMAT_INTEGER is wrong on (some) 64 bit platforms?
Date
Msg-id 51EF486E.7060307@tpf.co.jp
Whole thread Raw
In response to FORMAT_INTEGER is wrong on (some) 64 bit platforms?  (Matt Lilley <matt.lilley@securitease.com>)
Responses Re: FORMAT_INTEGER is wrong on (some) 64 bit platforms?  (Matt Lilley <matt.lilley@securitease.com>)
List pgsql-odbc
Hi Matt,

(2013/07/24 3:32), Matt Lilley wrote:
> Hello,
>
> I'm trying to understand the logic in psqlodbc.h where if the size of a
> long int is not 8 that FORMAT_INTEGER is set to "%ld".

Is the version 9.02.0100?
Does replacing SIZEOF_LONG_INT by SIZEOF_LONG work?

regards,
Hiroshi Inoue

 > I can't find any
> definitive documentation, but I gather from various forum posts that the
> size of SQL_C_LONG is always intended to be 4 bytes, independent of the
> host architecture. (This exact issue was first reported 9 years ago, it
> seems [1]). I don't think it should matter what size long int is on the
> host: surely it should only matter what the type being passed into
> SQLBindParameter is given as, since the data is packed by the caller,
> not the callee. My initial instinct was just to change the macro from
> "%ld" to "%d" (and similarly, "%lu" to "%u" for FORMAT_UINTEGER), but
> since there is quite a bit of code in there trying to make sense of it,
> I thought I'd check here.
>
> FWIW, I got here by trying to bind an integer column to -1 and getting
> an out-of-range error, just like Kelly in [1]. Changing the %ld -> %d
> fixes the symptoms for me. Is there any reason this can't be fixed?
>
> Regards,
> Matt




pgsql-odbc by date:

Previous
From: Dev Kumkar
Date:
Subject: Re: Fwd: configure: error: unixODBC library "odbcinst" not found while trying to compile odbc
Next
From: onur gulsevgi
Date:
Subject: Re: Fwd: configure: error: unixODBC library "odbcinst" not found while trying to compile odbc