Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1pex-0008Nt-0T for pgsql-odbc@arkaria.postgresql.org; Wed, 24 Jul 2013 03:22:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V1pew-0005pH-C7 for pgsql-odbc@arkaria.postgresql.org; Wed, 24 Jul 2013 03:22:38 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V1pev-0005pA-Di for pgsql-odbc@postgresql.org; Wed, 24 Jul 2013 03:22:37 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V1pel-0008Vg-7e for pgsql-odbc@postgresql.org; Wed, 24 Jul 2013 03:22:36 +0000 Received: (qmail 3023 invoked by uid 512); 24 Jul 2013 03:22:24 -0000 Received: from unknown (HELO ?127.0.0.1?) (100.126.1.62) by sd2.tpf-fw-c.co.jp with SMTP; 24 Jul 2013 03:22:24 -0000 Message-ID: <51EF486E.7060307@tpf.co.jp> Date: Wed, 24 Jul 2013 12:22:22 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Matt Lilley CC: pgsql-odbc@postgresql.org Subject: Re: FORMAT_INTEGER is wrong on (some) 64 bit platforms? References: <51EECC51.9040504@securitease.com> In-Reply-To: <51EECC51.9040504@securitease.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org 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 -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc