Bug #92700 Cursor in prepared and dictionary mode don't work
Submitted: 7 Oct 2018 20:33 Modified: 5 Jan 2023 19:42
Reporter: Sasa Gosovic Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / Python Severity:S3 (Non-critical)
Version:2.1.6, 8.0.12 OS:Any
Assigned to: CPU Architecture:Any

[7 Oct 2018 20:33] Sasa Gosovic
Description:
Error when using cursor in prepared and Dictionary mode together.

In document from page:
https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-cursor....

says:

If dictionary is True, the cursor returns rows as dictionaries. This argument is available as of Connector/Python 2.0.0.

If prepared is True, the cursor is used for executing prepared statements. This argument is available as of Connector/Python 1.1.2.

How to repeat:
It works when cursor is only in Dictionary mode:
cursor = db.conn.cursor(dictionary=True)

it works when cursor is only in Prepared mode:
cursor = db.conn.cursor(prepared=True)

but it doesn't work when used together:
cursor = db.conn.cursor(prepared=True, dictionary=True)

It throws error:
ValueError: Cursor not available with given criteria: dictionary, prepared
[7 Oct 2018 20:38] Sasa Gosovic
Error screenshot

Attachment: err.PNG (image/png, text), 277.93 KiB.

[8 Oct 2018 5:21] Takashi Sasaki
Hello,

I checked the implementation. I do not know the future, but now it seems that the combination of that option is not supported.

Document:
https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor.html

Source:
https://github.com/mysql/mysql-connector-python/blob/master/lib/mysql/connector/connection...
[9 Oct 2018 11:14] MySQL Verification Team
Hello Saša Gošović,

Thank you for the report!

regards,
Umesh
[20 Sep 2022 17:38] David Bergeron
Also a bug on
Python: 3.9.7
Connector: 8.0.12
[5 Jan 2023 19:39] Oscar Pacheco
Posted by developer:
 
Thanks, Sasa for your report. 

I am closing this bug since it is a duplicate of BUG#23339387. 

By the way, BUG#23339387 has already been fixed :D.

Regards.
[5 Jan 2023 19:42] Oscar Pacheco
Duplicated of BUG#81573.