9.0.5 issue - duplicate rows returned when using SQL_ATTR_ROW_ARRAY_SIZE attribute - Mailing list pgsql-odbc

From John Kew
Subject 9.0.5 issue - duplicate rows returned when using SQL_ATTR_ROW_ARRAY_SIZE attribute
Date
Msg-id CY1PR0301MB19784F9A1AC0529A01B832ACCCC00@CY1PR0301MB1978.namprd03.prod.outlook.com
Whole thread Raw
Responses Re: 9.0.5 issue - duplicate rows returned when using SQL_ATTR_ROW_ARRAY_SIZE attribute
List pgsql-odbc


We have been testing the new postgres driver and we found an issue with the SQL_ATTR_ROW_ARRAY_SIZE attribute. We use this attribute to request row sets in chunks with can align with cache boundaries and so-forth; it is a general optimization we use with a number of data sources. With 9.05 though, executing a query which returns a result set > SQL_ATTR_ROW_ARRAY_SIZE will result in the second fetch of rows being duplicates of the first fetch.


So let’s say we set this attribute to 84 (m_rowsToFetch) and use the m_rowStatus array to count the success rows.


SQLSetStmtAttrWhstmt[repeatIndex], SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER)m_rowsToFetchSQL_IS_UINTEGER );

SQLSetStmtAttrhstmt[repeatIndex], SQL_ATTR_ROW_STATUS_PTR, &m_rowStatus[0], 0 );

 

We then create two queries  - the first of which returns 24 rows normally and the second which returns 120 rows. The first query will return the correct results for both 9.03 and 9.05; 24 rows. The second query will perform two fetch operations. For 9.03 the first fetch returns 84 rows and the second 36 rows, correctly totaling 120 rows. For 9.05 we get 84 and 84 on the fetch counts, and it appears the second query has duplicate content.


I believe you could modify one of the bulk* tests to exhibit this behavior; or we can sanitize a small part of our regression suite and release a full repro in code.


-John

pgsql-odbc by date:

Previous
From: "Inoue, Hiroshi"
Date:
Subject: Re: New 9.5.0100 does not work properly
Next
From: John Kew
Date:
Subject: Re: 9.0.5 issue - duplicate rows returned when using SQL_ATTR_ROW_ARRAY_SIZE attribute