Closed agrvz closed 1 year ago
Thanks for the report. I'll take a look and get back to you on this!
I have pushed a patch that should correct this issue and added a relevant test case. If you are able to build from source you can verify that it corrects your issue as well.
This has been included in version 1.3.0 which was just released.
Just tested using 1.3.0 and working perfectly now. Thank you for fixing this issue, much appreciated!
Hello,
Unexpected behaviour.
I originally posted here with more detail: https://stackoverflow.com/questions/75487587/why-is-cursor-rowcount-higher-than-the-number-of-rows-returned-by-cursor-fetchal
When calling
cursor.fetchall()
(orcursor.fetchmany()
in batches), thecursor.rowcount
attribute is higher than the actual number of rows returned. However, this issue does not appear when using the same methods incx_Oracle
.For example, when selecting all records from a table with 93 rows,
cursor.rowcount
is 96, whereas I would expect it to be 93 to match the number of rows in the table.Notes on output (see output section below):
After the first batch,
rowcount
is already 20 - I would have expected it to be 10 hereAfter batch 8,
rowcount
is 100 - it has 'overshot' the actual table row count - which seems to indicaterowcount
does not necessarily reflect the number of rows actually fetched, but the number of rows attempted to be fetched, at least initiallyAfter the final batch (and also after the
fetchall()
call),rowcount
is 96 - I would expect it to be 93 herearraysize
, it seems to follow the patternr = t + (t mod a)
wherer = rowcount
,t = total table rows
, anda = arraysize
arraysize = 20
:Does your application call init_oracle_client()?
No.
SQL
Output