Bug #96701 | using fetchmany of mysql python connector returns incorrect result | ||
---|---|---|---|
Submitted: | 29 Aug 2019 20:05 | Modified: | 12 Dec 2019 5:07 |
Reporter: | Xin Xiao | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / Python | Severity: | S3 (Non-critical) |
Version: | 8.0.17, 8.0.18 | OS: | Linux (Linux Mint 19.2) |
Assigned to: | CPU Architecture: | Any |
[29 Aug 2019 20:05]
Xin Xiao
[29 Aug 2019 20:14]
Xin Xiao
the screenshot showing the table in my database
Attachment: Screen Shot 2019-08-29 at 4.13.00 PM.png (image/png, text), 1.80 MiB.
[29 Aug 2019 20:15]
Xin Xiao
the execution of repeated fetchmany
Attachment: Screen Shot 2019-08-29 at 4.13.53 PM.png (image/png, text), 2.42 MiB.
[30 Aug 2019 10:46]
MySQL Verification Team
Hello Xin iao, Thank you for the report. regards, Umesh
[13 Sep 2019 14:45]
Joshua Adelman
I wanted to add that I am seeing this bug as well using Python 3.7 and mysql-connector-python 8.0.17 on MacOS 10.14.6. Reproducing code: ``` import mysql.connector batch_size = 10000 # Create of `auth` removed for privacy auth = {...} src_con = mysql.connector.connect(**auth) cursor = src_con.cursor() qstr = 'select * from data' cursor.execute(qstr) while True: records = cursor.fetchmany(size=batch_size) rc_cnt = len(records) print(f'rc_cnt: {rc_cnt}') if rc_cnt == 0: break ``` This prints: ``` rc_cnt: 10000 rc_cnt: 10000 rc_cnt: 10000 rc_cnt: 10000 rc_cnt: 10000 rc_cnt: 10000 rc_cnt: 10000 rc_cnt: 7142 rc_cnt: 1 rc_cnt: 1 rc_cnt: 1 rc_cnt: 1 ... (until interrupted) ``` where `fetchmany` continues to return a list containing what appears to be a random record in the table (but that same record over and over) until I kill the process. I have run the same code using the same version of mysql-connector-python on Windows 10 and do not see the issue and the data is returned as expected.
[12 Dec 2019 5:07]
MySQL Verification Team
It turned out internally that it is duplicate of Bug #97830. Marking this as duplicate of Bug #97830. regards, Umesh