Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.

From: Nick Gorham <nick(at)lurcher(dot)org>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
Date: 2014-03-07 09:48:15
Message-ID: 531995DF.9010202@lurcher.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 07/03/14 08:09, Inoue, Hiroshi wrote:
> (2014/03/07 2:05), Przemyslaw Rzepecki wrote:
>> Hi,
>>
>> Thanks for the answer! I have compare my program with Yours didn't
>> noticed any logical difference. Then tried rerun the tests on two
>> different systems, any my tests ware passing on one but the errors ware
>> still present on the other.
>>
>> Tried to step by step eliminate all the differences and I believe its
>> the libodbcinst.so.2 vs libodbcinst.so.1 which cause the difference. It
>> works fine with unixodbc 1 but when I use a driver recompiled against
>> unixodbc 2 then the error happens.
>
> Functions used in lib(i)odbcinst are SQLGetPrivateProfileString()
> and SQLWritePrivateProfileString().
> Could you please take the Mylog output of your failure case
> by setting Debug=1 in your odbc.ini?
>
> regards,
> Hiroshi Inoue
>
>
Hi,

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).

--
Nick

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Heikki Linnakangas 2014-03-07 09:59:28 Re: SQLFetchScroll with SQL_ATTR_ROWS_FETCHED_PTR closing statement.
Previous Message Heikki Linnakangas 2014-03-07 08:12:07 Re: Removing support for < 7.4 servers