[CONPY-116] Wrong type for SQL type JSON Created: 2020-09-29  Updated: 2020-09-29  Resolved: 2020-09-29

Status: Closed
Project: MariaDB Connector/Python
Component/s: Generic
Affects Version/s: 1.0.2
Fix Version/s: 1.0.3

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


 Description   

Since MariaDB Server 10.5 data type JSON is not returned as MYSQL_TYPE_JSON anymore, but as MYSQL_TYPE_BLOB with extended field attributes, which results in wrong data type:

import mariadb
 
conn=mariadb.connect(db="test")
cursor=conn.cursor()
cursor.execute("create temporary table t1(a json)")
cursor.execute("insert into t1 values ('{}')")
cursor.execute("select * from t1");
fieldinfo= mariadb.fieldinfo()
info= cursor.description
print(fieldinfo.type(info[0]))
del cursor
del connection

Output:

BLOB



 Comments   
Comment by Georg Richter [ 2020-09-29 ]

Fixed in rev. 5d4a8d5d6242597c80f1f0b9740b68f7b743188b

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