From: Nick Gorham <nick@lurcher.org>
To: pgsql-odbc@postgresql.org
Subject: Re: ODBC : SQLGetData question
Date: Wed, 14 May 2014 11:08:14 +0100
Message-ID: <5373408E.2070404@lurcher.org> (raw)
In-Reply-To: <CALSLE1O=1c8_Cw+r8HOmz+AGSHDV1UKp5SJhMHTqLbcxyRu8PQ@mail.gmail.com>
References: <CALSLE1P5zWBBckGQaOKQzcN-jkR_nn5PSno_b-iRS6cR4H=uvA@mail.gmail.com>
<53730FFB.5020304@gmail.com>
<CALSLE1MLEDoi4aoEQdE093yJBJygATTFWYhTvgAqhsEDYvJ0Uw@mail.gmail.com>
<CALSLE1MSthQPLGdKDPC9cTozFSqWDzBeZtz6VnavY-Xjik6fGw@mail.gmail.com>
<53732D9D.1060605@gmail.com>
<CALSLE1O=1c8_Cw+r8HOmz+AGSHDV1UKp5SJhMHTqLbcxyRu8PQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
On 14/05/14 10:07, Dev Kumkar wrote:
>
> On Wed, May 14, 2014 at 2:17 PM, aihtdikh <aihtdikh@gmail.com
> <mailto:aihtdikh@gmail.com>> wrote:
>
> That will work around the issue, but I'm stumped as to why it was
> not working for you already.
>
> It seems like your platform must be 64bit, and something somewhere
> is converting what should be a 64bit SQLLEN into a 32bit value,
> but I can't find anywhere in the source that does anything unsafe
> in this regard - it's SQLLEN all the way.
>
> Edit: Ah, Nick may be on the right path there.
> Could the driver have been compiled with a different sqltypes.h
> than the application?
> If so, you could try compiling the driver under the same setup as
> your application to see if that fixes it.
>
>
> Regards,
> Harun
>
> Yes, the platform is 64-bit.
> We are deploying the driver as it is and not compiling it in-house
> currently.
In that case compile the application with the same setup as the driver.
>
> Do you see any issues with the (int) typecast done for SQLLEN?
Yes, if your app ever expects the driver to return an array of results
(for example) it will go badly wrong very quickly. Also, if the driver
is 64 bit SQLLEN and the application 32 bit, a SQLGetData will be
writing to memory that happens to be after the indicator variable, that
will not end well.
--
Nick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: nick@lurcher.org
Subject: Re: ODBC : SQLGetData question
In-Reply-To: <5373408E.2070404@lurcher.org>
References: <CALSLE1P5zWBBckGQaOKQzcN-jkR_nn5PSno_b-iRS6cR4H=uvA@mail.gmail.com> <53730FFB.5020304@gmail.com> <CALSLE1MLEDoi4aoEQdE093yJBJygATTFWYhTvgAqhsEDYvJ0Uw@mail.gmail.com> <CALSLE1MSthQPLGdKDPC9cTozFSqWDzBeZtz6VnavY-Xjik6fGw@mail.gmail.com> <53732D9D.1060605@gmail.com> <CALSLE1O=1c8_Cw+r8HOmz+AGSHDV1UKp5SJhMHTqLbcxyRu8PQ@mail.gmail.com> <5373408E.2070404@lurcher.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox