Re: Bug report: x64 Row status Array uses wrong data type

From: "Inoue, Hiroshi" <h-inoue(at)dream(dot)email(dot)ne(dot)jp>
To: Jari Siikarla <jari(dot)siikarla(at)ddswireless(dot)com>
Cc: "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Bug report: x64 Row status Array uses wrong data type
Date: 2018-05-12 02:14:47
Message-ID: 97ae1e0f-fd75-33ea-b639-3ad92cff1daf@dream.email.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hi Jari,

On 2018/05/11 18:33, Jari Siikarla wrote:
>
> Hi
>
> Thank you for psq odbc driver!
>
> I’ve found an issue with 64 bit driver.
>
> The array returned from fetch for row statuses uses 16 bit values
>
> instead of 64 bit values.
>
> Tested on x64 Windows (7, 10, srv2012 and srv2016)
>
> with 64 bit psqlodbc-09.06.0500 (Unicode and ANSI)
>
> Client is set ODBC version 2
>
> Changing SQLUSMALLINT to SQLSETPOSIROW in descriptor.h
>
> for two structs and in the code handling these structs fixed the issue.
>
> Code in psqlodbc-10.02.0000 is the same for these parts.
>

Where can I find the description that SQL_ATTR_ROW_STATUS_PTR
(or SQL_ATTR_PARAM_STATUS_PTR) doesn't point to an array of
SQLUSMALLINT but SQLSETPOSIROW?

regards,
Hiroshi Inoue

> struct IRDFields_
>
> {
>
> StatementClass                          *stmt;
>
> SQLULEN                                     *rowsFetched;
>
> -> SQLSETPOSIROW                       *rowStatusArray;
>
> UInt4                                            nfields;
>
> SQLSMALLINT  allocated;
>
> FIELD_INFO      **fi;
>
> };
>
> struct IPDFields_
>
> {
>
> SQLULEN *param_processed_ptr;
>
> -> SQLSETPOSIROW *param_status_ptr;
>
> SQLSMALLINT                             allocated;
>
> ParameterImplClass                  *parameters;
>
> };
>
> Below pseudo code reproduces the issue:
>
> SQLUINTEGER rowsFetched=0;
>
> SQLSETPOSIROW pRowStatus[1];
>
> SQLRETURN retCode;
>
> pRowStatus[0]=-1; // 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
>
> retCode=SQLSetStmtAttr(hStmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)1, 0);
>
> retCode=SQLSetStmtAttr(hStmt, SQL_ATTR_ROWS_FETCHED_PTR, &rowsFetched, 0);
>
> retCode=SQLSetStmtAttr(hStmt, SQL_ATTR_ROW_STATUS_PTR, pRowStatus, 0);
>
> retCode=SQLFetchScroll(hStmt, SQL_FETCH_NEXT, 1);
>
> // pRowStatus
>
> // after fetch   0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00
>
> // exected to be 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
>
> Thank you,
>
> Jari Siikarla
>

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Clemens Ladisch 2018-05-12 15:25:10 Re: Bug report: x64 Row status Array uses wrong data type
Previous Message Jari Siikarla 2018-05-11 09:33:20 Bug report: x64 Row status Array uses wrong data type