Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
1.0.5
-
None
-
CentOS 7
MariaDB 10.5.8-MariaDB-log
Python 3.9.1
Description
Hello,
I noticed different types are returned when querying (at least) columns of VARCHAR and CHAR types depending upon prepared, but consistent for TEXT.
When the query is executed (not prepared), the connector returns `str` which is expected from my reading of PEP 249.
However, if `prepared=True` is used when creating the cursor, the returned values are of type `bytes` for VARCHAR and CHAR.
I would expect the returned types to be consistent, regardless of being a prepared statement.
https://gist.github.com/leeclemens/812027ba306363de61266135e31e30c9
Produces:
Testing BASE_QRY
|
[<class 'str'>, <class 'str'>]
|
[<class 'str'>, <class 'str'>]
|
Testing WHERE_QRY
|
[<class 'str'>, <class 'str'>]
|
Testing PREPARED_QRY
|
[<class 'bytes'>, <class 'str'>]
|