Bug #95567 fetchmany() doesn't send an empty list when there are no more rows
Submitted: 29 May 2019 15:43 Modified: 30 May 2019 10:05
Reporter: Andrew Spode Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / Python Severity:S1 (Critical)
Version:8.0.16 OS:Linux (Docker Python3 Image)
Assigned to: CPU Architecture:Any

[29 May 2019 15:43] Andrew Spode
Description:
When fetching rows using .fetchmany(1000), when you get to the end, as per the documentation (and previous versions) you should get an empty list to signify there are no more rows.

Instead, you will keep getting back a list with the very last row in the array, so you can't check to see if it's over.

How to repeat:
while True:
    rows = cursor.fetchmany(1000)
    if rows == []:
        break

    #This should print the same row over and over again once it reaches the end
    if len(rows) ==1:
        print(rows)

Suggested fix:
NA
[30 May 2019 9:26] MySQL Verification Team
Hello Andrew Spode,

Thank you for the report.
This is duplicate of Bug #91971, please see Bug #91971

regards,
Umesh
[30 May 2019 10:05] Andrew Spode
Hi Umesh,

I'm not sure how this is a duplicate "the command never returns and eats memory until the OS kills it." - that doesn't sound the same as I'm describing.

Moreover - that bug is nearly a year old and not fixed. Both are fundamental functionalities.

Has this library been abandoned? Should I be switching to something else?