From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Nick Gorham <nick@lurcher.org>
Cc: pgsql-odbc@postgresql.org
Subject: Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
Date: Fri, 07 Mar 2014 11:59:28 +0200
Message-ID: <53199880.1060107@vmware.com> (raw)
In-Reply-To: <531995DF.9010202@lurcher.org>
References: <1385453596.4529.206.camel@salti.rnd.ki.sw.ericsson.se>
<5315E154.3080406@vmware.com>
<1394125507.15011.18.camel@salti.rnd.ki.sw.ericsson.se>
<53197EA7.6070700@tpf.co.jp>
<531995DF.9010202@lurcher.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
On 03/07/2014 11:48 AM, Nick Gorham wrote:
> I hope you don't mind me posting to your list as a observer, but I
> noticed the following in the original code
>
> SQLINTEGER int_array[ARRAY_SIZE];
>
> /* Bind */
> rc = SQLBindCol(hstmt, 1, SQL_INTEGER, int_array, sizeof(SQLLEN),
> ind_array);
> CHECK_STMT_RESULT(rc, "SQLBindCol failed", hstmt);
>
> I would have thought
>
> /* Bind */
> rc = SQLBindCol(hstmt, 1, SQL_INTEGER, int_array,
> sizeof(SQLINTEGER), ind_array);
> CHECK_STMT_RESULT(rc, "SQLBindCol failed", hstmt);
>
> Was what it should have been. The driver will have written past the end
> of int_array, and overwritten the handle (I guess).
The buffer-length argument is ignored with fixed-length data. Although I
agree on readability grounds that it should be sizeof(SQLINTEGER), to
match SQL_INTEGER, or 0 to make it clear that it's ignored.
- Heikki
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
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: hlinnakangas@vmware.com, nick@lurcher.org
Subject: Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
In-Reply-To: <53199880.1060107@vmware.com>
References: <1385453596.4529.206.camel@salti.rnd.ki.sw.ericsson.se> <5315E154.3080406@vmware.com> <1394125507.15011.18.camel@salti.rnd.ki.sw.ericsson.se> <53197EA7.6070700@tpf.co.jp> <531995DF.9010202@lurcher.org> <53199880.1060107@vmware.com>
* 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