Bug #91095 Bug: mysql connector cursor execute with multi option is broken in python 3.7
Submitted: 31 May 2018 19:24 Modified: 4 Jun 2018 15:30
Reporter: Nenad J Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / Python Severity:S1 (Critical)
Version:8.0.11 OS:Windows (10 Home)
Assigned to: CPU Architecture:x86 (64 bit)
Tags: mysql connector python mysql-connector-python cursor execute

[31 May 2018 19:24] Nenad J
Description:
Error with python 3.7 when iterating over results of cursor.execute(...,multi=True)

Deprecation warning with python 3.6 when iterating over results of cursor.execute(...,multi=True)

P.S. Please refactor your code to conform to
PEP 479 -- Change StopIteration handling inside generators
https://www.python.org/dev/peps/pep-0479/

How to repeat:
# python code
import mysql.connector
db_conn = { 'host':'my-server','user':'my-user','password':'my-pwd','port':3306 }
conn = mysql.connector.connect(**db_conn)
cur_multi = conn.cursor(dictionary=True)
cursors = cur_multi.execute(operation="select * from table_a;select * from table_b;",multi=True)
for cur in cursors: # <--- this line causes error with python 3.7 and deprecation warning with python 3.6
	cur.fetchall()
cur_multi.close()
conn.close()

Suggested fix:
Please refactor your code to conform to
PEP 479 -- Change StopIteration handling inside generators
https://www.python.org/dev/peps/pep-0479/
[4 Jun 2018 7:42] Chiranjeevi Battula
Hello Nenad,

Thank you for the bug report.
This is most likely duplicate of Bug #87818, please see Bug #87818

Thanks,
Chiranjeevi.
[4 Jun 2018 15:30] Nenad J
Hi Chiranjeevi,
It may as well be, but the other one is not marked with proper severity - it should be critical. If you leave it as S3, it may never be fixed - it has been sitting ignored for 9 months. Also, my entry has far better description with more details, thus far more helpful for fixing. In any case, what's the ETA for this fix bug for it's critical?