[CONPY-98] CAST AS binary doesn't return binary Created: 2020-08-07  Updated: 2020-08-07  Resolved: 2020-08-07

Status: Closed
Project: MariaDB Connector/Python
Component/s: Generic
Affects Version/s: 1.0.0
Fix Version/s: 1.0.1

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

When casting to binary the fetched result will be a unicode string instead of a binary:

Python 3.8.2rc2+ (heads/3.8-dirty:44c6901, Jul 28 2020, 18:31:20) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mariadb
>>> 
>>> conn= mariadb.connect()
>>> cursor=conn.cursor()
>>> cursor.execute("SELECT CAST('foo' AS BINARY) AS anon_1 WHERE 1=?", (1,))
>>> cursor.fetchone()
('foo',)
>>> cursor.execute("SELECT CAST('foo' AS BINARY) AS anon_1")
>>> cursor.fetchone()
('foo',)



 Comments   
Comment by Georg Richter [ 2020-08-07 ]

rev. a749c538599ca5e277e097df4f32756847c02745

Generated at Thu Feb 08 03:30:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.