Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WLrZ7-0000ea-7n for pgsql-odbc@arkaria.postgresql.org; Fri, 07 Mar 2014 09:59:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WLrZ6-00046W-Jk for pgsql-odbc@arkaria.postgresql.org; Fri, 07 Mar 2014 09:59:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WLrZ4-00046N-PL for pgsql-odbc@postgresql.org; Fri, 07 Mar 2014 09:59:38 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WLrZ0-0006cu-8y for pgsql-odbc@postgresql.org; Fri, 07 Mar 2014 09:59:37 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id BF1452819E; Fri, 7 Mar 2014 01:59:30 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id B9BB84039E; Fri, 7 Mar 2014 01:59:30 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 187A1C0051; Fri, 7 Mar 2014 01:59:28 -0800 (PST) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Fri, 7 Mar 2014 01:59:27 -0800 (PST) Message-ID: <53199880.1060107@vmware.com> Date: Fri, 07 Mar 2014 11:59:28 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Nick Gorham CC: pgsql-odbc@postgresql.org Subject: Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement. 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> In-Reply-To: <531995DF.9010202@lurcher.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) 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 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